Page 1 of 1

MDX Syntax

Posted: Tue Mar 29, 2016 4:55 pm
by Jayme1
Hello everyone

I have created a subset using SubsetCreateByMdx - I now want to change the parent selection to run from the Variable on the Process ( instead of being hard coded)


Code: Select all

SubsetCreatebyMDX('CostCDetailReport', '{TM1SORT( {TM1FILTERBYLEVEL( {DESCENDANTS([r_Cost_Centre].[200] )}, 0)}, ASC)} ' );
So currently the above works fine, however when i change the [200] to [Pcc] it stops working. (Pcc is the parameter for the cost centre parent which is also set to "200")

Code: Select all

SubsetCreatebyMDX('CostCDetailReport', '{TM1SORT( {TM1FILTERBYLEVEL( {DESCENDANTS([r_Cost_Centre].[Pcc] )}, 0)}, ASC)} ' );

I get the following error - "PCU" : object not found expression: - i assume this is due to the parameter automatically having quotations attached.

Can anyone help with the syntax for this please?

Thanks for all your help

Jaimie

Re: MDX Syntax

Posted: Tue Mar 29, 2016 5:03 pm
by qml
With pleasure.

Code: Select all

SubsetCreatebyMDX('CostCDetailReport', '{TM1SORT( {TM1FILTERBYLEVEL( {DESCENDANTS([r_Cost_Centre].[' | Pcc | '] )}, 0)}, ASC)} ' );

Re: MDX Syntax

Posted: Wed Mar 30, 2016 8:08 am
by Jayme1
Thank you very much for your help, worked perfectly

Cheers