MDX Syntax

Post Reply
Jayme1
Posts: 14
Joined: Thu Mar 27, 2014 5:30 pm
OLAP Product: turbo intergrator
Version: cognos express
Excel Version: Excel 2009

MDX Syntax

Post 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
User avatar
qml
MVP
Posts: 1097
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: MDX Syntax

Post by qml »

With pleasure.

Code: Select all

SubsetCreatebyMDX('CostCDetailReport', '{TM1SORT( {TM1FILTERBYLEVEL( {DESCENDANTS([r_Cost_Centre].[' | Pcc | '] )}, 0)}, ASC)} ' );
Kamil Arendt
Jayme1
Posts: 14
Joined: Thu Mar 27, 2014 5:30 pm
OLAP Product: turbo intergrator
Version: cognos express
Excel Version: Excel 2009

Re: MDX Syntax

Post by Jayme1 »

Thank you very much for your help, worked perfectly

Cheers
Post Reply