Using a loop to check an mdx

Post Reply
samiamsz
Posts: 9
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 » Tue Sep 08, 2020 3:08 pm

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: 2079
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: 10.2.2., PAW
Excel Version: Nearly all of them

Re: Using a loop to check an mdx

Post by Steve Rowe » Tue Sep 08, 2020 3:27 pm

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

Post Reply