Skip consolidated element during TI data loading

Post Reply
appleglaze28
Regular Participant
Posts: 269
Joined: Tue Apr 21, 2009 3:43 am
OLAP Product: Cognos TM1, Planning
Version: 9.1 SP3 9.4 MR1 FP1 9.5
Excel Version: 2003

Skip consolidated element during TI data loading

Post by appleglaze28 »

I created a Excel template where I will be loading the same data for all element, how do I skip the consolidated element so I won't have any issues or error after the process was ran.

Code: Select all

i = DIMSIZ('base_customers_and_distributors');
while(i>1);
hierarchy = DIMNM('base_customers_and_distributors',i);
CellPutS(pDiscount,'CD_customer_setting',hierarchy,'Eligible for Forecast Accuracy Discount?');
CellPutN(pRate,'CD_customer_setting',hierarchy,'Preferred Discount');
i = i-1;
end;
asutcliffe
Regular Participant
Posts: 164
Joined: Tue May 04, 2010 10:49 am
OLAP Product: Cognos TM1
Version: 9.4.1 - 10.1
Excel Version: 2003 and 2007

Re: Skip consolidated element during TI data loading

Post by asutcliffe »

Can't you just check whether the cell is updateable before calling cellputn? It won't be if it's a consolidation.

http://publib.boulder.ibm.com/infocente ... eable.html
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: Skip consolidated element during TI data loading

Post by lotsaram »

Better to simply skip over consolidations and not process them at all.

ViewExtractSkipCalcsSet(Cube, View, 1);
appleglaze28
Regular Participant
Posts: 269
Joined: Tue Apr 21, 2009 3:43 am
OLAP Product: Cognos TM1, Planning
Version: 9.1 SP3 9.4 MR1 FP1 9.5
Excel Version: 2003

Re: Skip consolidated element during TI data loading

Post by appleglaze28 »

Code: Select all

i = DIMSIZ('base_customers_and_distributors');
while(i>1);
hierarchy = DIMNM('base_customers_and_distributors',i);
CellPutS(pDiscount,'CD_customer_setting',hierarchy,'Eligible for Forecast Accuracy Discount?');
CellPutN(pRate,'CD_customer_setting',hierarchy,'Preferred Discount');
i = i-1;
end;

ViewExtractSkipCalcsSet('CD_customer_setting', 'Customer Setting', 1);
I'm have this error log, can anyone help me out? The rules I have is just to average the value on the consolidated elements.
Error: Prolog procedure line (11): Rule applies to cell
Error: Prolog procedure line (11): error repeats 2 times
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: Skip consolidated element during TI data loading

Post by lotsaram »

appleglaze28 - ViewExtractSkipCalcsSet applies to a VIEW as a data source. Obviously if your CellPutN is on the Prolog and you are doing a while loop through an entire dimension then ViewExtractSkipCalcsSet will have no effect on the records that are processed. To use this you would define a view in the CD_customer_setting cube, set this as the data source for your process and transfer the code (minus the while loop) to the data tab.

Alternately if you want to keep your code in the prolog you could either
1/ As already suggested use a CellIsUpdateable test to wrap your CellPut statements in. For example:
IF( CellIsUpdateable('CD_customer_setting',hierarchy,'Preferred Discount') = 1 );
CellPutN(pRate,'CD_customer_setting',hierarchy,'Preferred Discount');
ENDIF;
2/ loop through only N level elements of the base_customers_and_distributors dimension by looping through a subset of N elements rather than the entire dimension

This is pretty basic stuff.

You have been trying to do TM1 for quite some time now, but quite honestly my patience has run out. Until you take time to actually sit down and read through the manuals and maybe go and get yourself some proper training then I'm not sure that there's anything more I can do to help you.
Post Reply