
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;