MDX in one dimension based on the subset of another dimension

Post Reply
EP_explorer
Regular Participant
Posts: 221
Joined: Sat Dec 04, 2010 2:35 pm
OLAP Product: PAL
Version: 2.0.9
Excel Version: 2016

MDX in one dimension based on the subset of another dimension

Post 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.
burnstripe
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

Post 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
MarenC
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

Post by MarenC »

Hi,

a non dynamic example would be:

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

Maren
EP_explorer
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

Post by EP_explorer »

Thank you
It works
MarenC
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

Post 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
User avatar
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

Post by Elessar »

Heeey, that was one of my quiz questions! Maren could have earned another point :)
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 7th article - Development requirements.
EP_explorer
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

Post 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:
Post Reply