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.
MDX in one dimension based on the subset of another dimension
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016
-
- Regular Participant
- Posts: 219
- Joined: Wed May 06, 2020 2:58 pm
- OLAP Product: Planning Analytics
- Version: 2.0.9
- Excel Version: 2016
Re: MDX in one dimension based on the subset of another dimension
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
-
- Regular Participant
- Posts: 409
- Joined: Sat Jun 08, 2019 9:55 am
- OLAP Product: Planning Analytics
- Version: Planning Analytics 2.0
- Excel Version: Excel 2016
Re: MDX in one dimension based on the subset of another dimension
Hi,
a non dynamic example would be:
{GENERATE(TM1SUBSETTOSET([Dim1], 'Sub1' ), {StrToMember("[Dim2].[" + [Dim1].currentmember.name + "]")})}
Maren
a non dynamic example would be:
{GENERATE(TM1SUBSETTOSET([Dim1], 'Sub1' ), {StrToMember("[Dim2].[" + [Dim1].currentmember.name + "]")})}
Maren
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016
Re: MDX in one dimension based on the subset of another dimension
Thank you
It works
It works
-
- Regular Participant
- Posts: 409
- Joined: Sat Jun 08, 2019 9:55 am
- OLAP Product: Planning Analytics
- Version: Planning Analytics 2.0
- Excel Version: Excel 2016
Re: MDX in one dimension based on the subset of another dimension
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
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
- Elessar
- Community Contributor
- Posts: 407
- Joined: Mon Nov 21, 2011 12:33 pm
- OLAP Product: PA 2
- Version: 2.0.9
- Excel Version: 2016
- Contact:
Re: MDX in one dimension based on the subset of another dimension
Heeey, that was one of my quiz questions! Maren could have earned another point
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016