spread from total to months 1-12 through TI process

Post Reply
BigG
Community Contributor
Posts: 211
Joined: Tue Sep 15, 2009 11:13 pm
OLAP Product: IBMPA
Version: PA 2.0 Cloud
Excel Version: 2010

spread from total to months 1-12 through TI process

Post by BigG »

Hi, Just wondering if this is the best way to do a process like this ;)

I have an numeric attribute Month_Number (1 to 12) for a measures dimension with month elements (has commmentary string element so measure dimension). I use this attribute for even spreading from source cube (Total level/12) to the target 'Budget' cube with the measure dimension Budget_m (has the months and Month_Number attribute).

Easiest way I can see to do this is below (TI). Am I missing something? Thanks for responses in advance


Code: Select all

#Load Jun to July based on the numeric attribute Month_Number in Measure dimension
count=1;

#calc the total number of elements for dimension
while (count <= DIMSIZ(Budget_m'));

#Find Element name
MyElname=DIMNM(Budget_m', count);

#Check Month_Number is 1-12
IF(ATTRN('Budget_m', MyElname, 'Month_Number') >0 & ATTRN('Budget_m', MyElname, 'Month_Number')<13);

#Put 1/12 of value in each month for even spread
CellPutN(vValue/12, 'Budget',myCurrentVersion, myCurrentYear,dim5,dim4,myElname);

ENDIF;

count=count+1;

end;
GG
User avatar
mce
Community Contributor
Posts: 352
Joined: Tue Jul 20, 2010 5:01 pm
OLAP Product: Cognos TM1
Version: Planning Analytics Local 2.0.x
Excel Version: 2013 2016
Location: Istanbul, Turkey

Re: spread from total to months 1-12 through TI process

Post by mce »

This looks ok to me.
BigG
Community Contributor
Posts: 211
Joined: Tue Sep 15, 2009 11:13 pm
OLAP Product: IBMPA
Version: PA 2.0 Cloud
Excel Version: 2010

Re: spread from total to months 1-12 through TI process

Post by BigG »

cheers!
GG
Post Reply