Using a loop to check an mdx

Post Reply
samiamsz
Posts: 18
Joined: Wed Sep 02, 2020 3:08 pm
OLAP Product: tm1
Version: 11.3. 0.
Excel Version: 16

Using a loop to check an mdx

Post by samiamsz »

I wrote an mdx statement
sMDX= '{ DRILLDOWNMEMBER( { DRILLDOWNMEMBER( { DRILLDOWNMEMBER( {TM1FILTERBYLEVEL( {TM1Subsetall()}, 2)}, {[Category_Test].[category director]} ) }, {[Category_Test].[category 2]} ) }, {[Category_Test].[category 3]} ) }';
if(SUBSETEXIST(sDim,sMDX)=1;
subsetdestroy(sDim,sMDX);
endif;
SubsetCreate ( 'Category_Test' , 'sMDX');

Basically I have three drop downs, each being the child of the previous. How would i loop this so that it can create a new dynamic subset for each element i choose(the dynamic subset would contain the children of the chosen element)
User avatar
Steve Rowe
Site Admin
Posts: 2456
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Using a loop to check an mdx

Post by Steve Rowe »

Hi,
You need to use the StrToMember function to pull the reference from the previous selection into the next MDX subset.

There are some examples on this thread
Technical Director
www.infocat.co.uk
Post Reply