Page 1 of 1

MDX in one dimension based on the subset of another dimension

Posted: Mon Dec 02, 2024 8:14 am
by EP_explorer
I have 2 dimensions with the same elements (Dim1 and Dim2)

First dimension Dim1 using in Setup_Cube where put some flags on some elements. Exist subset Sub1 which filter elements in Dim1 based on flags.

Is it possible to create MDX subset Sub2 in Dim2 which contains the same elements as Sub1 in Dim1?
May be based on flags on Setup_Cube - but it contain Dim1.

Re: MDX in one dimension based on the subset of another dimension

Posted: Mon Dec 02, 2024 9:44 am
by burnstripe
Yes it's possible, you could use the Generate function to do this. I'm not at a pc today but if noone comes back I can post an example tomorrow

Re: MDX in one dimension based on the subset of another dimension

Posted: Mon Dec 02, 2024 10:06 am
by MarenC
Hi,

a non dynamic example would be:

{GENERATE(TM1SUBSETTOSET([Dim1], 'Sub1' ), {StrToMember("[Dim2].[" + [Dim1].currentmember.name + "]")})}

Maren

Re: MDX in one dimension based on the subset of another dimension

Posted: Mon Dec 02, 2024 10:58 am
by EP_explorer
Thank you
It works

Re: MDX in one dimension based on the subset of another dimension

Posted: Mon Dec 02, 2024 11:13 am
by MarenC
Hi,

Though this one might be better just in case an element doesn't exist in the dimension:

{GENERATE(TM1SUBSETTOSET([Dim1], 'Sub1' ), FILTER(TM1FILTERBYLEVEL( {TM1SUBSETALL( [Dim2] )}, 0), [Dim1].Currentmember.name = [Dim2].Currentmember.name ))}

Maren

Re: MDX in one dimension based on the subset of another dimension

Posted: Tue Dec 03, 2024 6:46 am
by Elessar
Heeey, that was one of my quiz questions! Maren could have earned another point :)

Re: MDX in one dimension based on the subset of another dimension

Posted: Wed Dec 04, 2024 12:01 pm
by EP_explorer
Elessar wrote: Tue Dec 03, 2024 6:46 am Heeey, that was one of my quiz questions! Maren could have earned another point :)
You can give me a point for the good question :lol: