Page 1 of 1

spread from total to months 1-12 through TI process

Posted: Thu Jan 06, 2011 10:55 pm
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;

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

Posted: Sat Jan 08, 2011 3:59 pm
by mce
This looks ok to me.

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

Posted: Sun Jan 09, 2011 11:08 pm
by BigG
cheers!