Hi Guys,
I had an issue with subset creation and when I moved a part of code to epilog it started working. Can you tel me if there was anything wrong having the code in prolog itself .
Prolog : Creating a subset through a mdx statement .
Subset Name : ALL X Customers
Now with All X customers subset as reference creating an another subset with some filter add to it .
vSize = SUBSETGETSIZE( vDimensionName, vSourceSubset );
WHILE( vSize > 0 );
vElement = SUBSETGETELEMENTNAME( vDimensionName, vSourceSubset, vSize );
vCustomerGrade = CELLGETS( 'AR History', vElement, 'US01', vPeriod, 'All Currencies', 'Local Currency', '120000', 'All Customer Types', 'Letter Grade' );
IF( vCustomerGrade @= 'F' );
SUBSETELEMENTINSERT( vDimensionName, vSubsetName, vElement, 1 );
ENDIF;
vSize = vSize - 1;
END;
Now both these subsets work great . I now add a third subset below this line of code in prolog which is also built from the 1 st subset as a base .
vSubsetName = 'All Y customers';
vSourceSubset = 'ALL X Customers';
vDimensionName = 'Customers SoldTo';
vSourceDim = 'Customers SoldTo Only';
IF( SUBSETEXISTS( vDimensionName, vSubsetName ) = 1 );
SUBSETDELETEALLELEMENTS( vDimensionName, vSubsetName );
ELSE;
SUBSETCREATE( vDimensionName, vSubsetName );
ENDIF;
vSize = SUBSETGETSIZE( vSourceDim, vSourceSubset );
WHILE( vSize > 0 );
vElement = SUBSETGETELEMENTNAME( vSourceDim, vSourceSubset, vSize );
IF( DIMIX( vDimensionName, vElement ) = 0 );
ITEMREJECT( 'The Specified Customer DNE in the Customers SoldTo Dimension: ' | vElement );
ELSE;
SUBSETELEMENTINSERT( vDimensionName, vSubsetName, vElement, 1 );
ENDIF;
vSize = vSize - 1;
END;
Now the subset All Y customers is partially created when the code is in prolog and is fully created when the code is in epilog(bold code in epilog now) .
Is the reference of the main subset not released in pro log . Not sure why this is happening .
Any suggestions are welcome .
subset creation moved to epilog and worked
-
- Posts: 128
- Joined: Tue May 23, 2017 12:45 pm
- OLAP Product: Tm1
- Version: 9.5
- Excel Version: 2010
-
- MVP
- Posts: 3113
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.0.9.18
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: subset creation moved to epilog and worked
ITEMREJECT in the Prolog tab is not the correct function here for you, I guess, given that it's the Prolog tab ?
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 128
- Joined: Tue May 23, 2017 12:45 pm
- OLAP Product: Tm1
- Version: 9.5
- Excel Version: 2010
Re: subset creation moved to epilog and worked
let me check .
Thanks
Thanks
-
- MVP
- Posts: 3652
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: subset creation moved to epilog and worked
ItemReject on the Prolog is quite fine. It is just that as Prolog has no data source and executes only 1x that the ItemReject will skip the rest of the Prolog code from that point.Wim Gielis wrote: ↑Mon Aug 14, 2017 7:06 pm ITEMREJECT in the Prolog tab is not the correct function here for you, I guess, given that it's the Prolog tab ?
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
-
- MVP
- Posts: 3113
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.0.9.18
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: subset creation moved to epilog and worked
That's what I meant indeed. Potentially a lot of elements in the subset are skipped.lotsaram wrote: ↑Tue Aug 15, 2017 6:26 amItemReject on the Prolog is quite fine. It is just that as Prolog has no data source and executes only 1x that the ItemReject will skip the rest of the Prolog code from that point.Wim Gielis wrote: ↑Mon Aug 14, 2017 7:06 pm ITEMREJECT in the Prolog tab is not the correct function here for you, I guess, given that it's the Prolog tab ?
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 128
- Joined: Tue May 23, 2017 12:45 pm
- OLAP Product: Tm1
- Version: 9.5
- Excel Version: 2010
Re: subset creation moved to epilog and worked
Yes that was the issue . Thanks All !!