Store the Subset elements

Post Reply
krithika331
Posts: 44
Joined: Thu May 01, 2014 12:46 pm
OLAP Product: Cognos TM1
Version: 10.2
Excel Version: 2010

Store the Subset elements

Post by krithika331 »

Hi,

I need to retrieve the Level 1 elements in a dimension and store in a variable. I want to create it using the subsetcreatebyMDX and not using the datasource. The elements retrieved had to be stored into a variable and use the vairable to update a dimension ( perform componentadd). I am new to Tm1 work. Any idea plz??
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Store the Subset elements

Post by tomok »

Please read the request for assistance guidelines.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Store the Subset elements

Post by BariAbdul »

You have to use subsetcreatebyMDX and along the MDX statement on similar lines
{TM1FILTERBYLEVEL( {TM1SUBSETALL( [StoreLevel_CMO] )}, 0)} and that subset as variable vSubmdx=the subset created by you
Thanks.
"You Never Fail Until You Stop Trying......"
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Store the Subset elements

Post by BariAbdul »

I think it is bit more clear
SubsetCreatebyMDX('SubsetName', '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [DimName] )}, 0,1)}' );
and assign this as variable.Thanks
"You Never Fail Until You Stop Trying......"
krithika331
Posts: 44
Joined: Thu May 01, 2014 12:46 pm
OLAP Product: Cognos TM1
Version: 10.2
Excel Version: 2010

Re: Store the Subset elements

Post by krithika331 »

Thanks for reply. I am doing the same as above. After I am assigning to the variable i am not getting error, but when I do the dimensionelementinsert , i am getting the invalid string expression. I have checked the syntax but it is showing correct.
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Store the Subset elements

Post by BariAbdul »

Can you please post what you are trying.
"You Never Fail Until You Stop Trying......"
krithika331
Posts: 44
Joined: Thu May 01, 2014 12:46 pm
OLAP Product: Cognos TM1
Version: 10.2
Excel Version: 2010

Re: Store the Subset elements

Post by krithika331 »

Below is the simple code i am executing:

Prolog:

z =SubsetCreatebyMDX('sub1', '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Dim1] )}, 1)}' );

DimensionElementInsert ( 'Dim2', '', z, 'n' );
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Store the Subset elements

Post by lotsaram »

krithika331 wrote:Below is the simple code i am executing:

Prolog:

z =SubsetCreatebyMDX('sub1', '{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Dim1] )}, 1)}' );

DimensionElementInsert ( 'Dim2', '', z, 'n' );
Stop and think about what you are doing. Exercise your thinking skills no matter how much of a couch potato they might be.

You are assigning z the VALUE of the SubsetCreateByMDX function which will return a NUMERIC value indicating successful completion or failure.
You are then trying to insert the value of z into a dimension.
It should be obvious by now what you are doing wrong.
After creating Sub1 in Dim1 you need to setup a WHILE LOOP to process the MEMBER SET belonging to Sub1 and insert the members into Dim2.
If it is now not obvious then you might just be beyond help.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Post Reply