Page 1 of 1

same cube CellGetN for a IF argument and CellPutN

Posted: Thu Jan 06, 2011 6:28 am
by BigG
Hi there,

I have a 'detailed cube' with a string element in measure dimension - REGION. Within the same cube and measure dimension I have numeric VALUE.

A global cube holds region % rates. Region is a dimension for this global cube.

A TI Process transforms the VALUE into further detail by multiplying by each regions % rates. To get the correct % we need to refer to what REGION from string in detailed cube, then get the related % from global cube.

I havent fully tested this but Is the best way to do this by (not true syntax below but basic logic)

Code: Select all

IF(cellgets(detailed cube)) = 'a region';
CellPutN(target cube*% a region)
ELSEIF(cellgets(detailed cube)) = 'another  region';
CellPutN(target cube* another region)

Re: same cube CellGetN for a IF argument and CellPutN

Posted: Thu Jan 06, 2011 1:23 pm
by tomok
There is no need to do a list of IF and ELSEIF's as long as the value in the REGION element of the measures dimension corresponds EXACTLY to one of the elements in the REGION dimesion of the global cube. I don't know where the value you are multiplying by the rate is coming from since I don't know the source in your TI process. Assuming you are using a view from the detail cube which pulls VALUE, and your "Target" cube has a measures dimension with a numeric element called "VALUE", you can just do this:

Region = CellGets('detailed',Dim1, Dim2,..DimX,'REGION');
Rate = CellGetN('Global',Dim1, Dim2,..DimX,Region);
NewValue = VALUE * Rate;
CellPutN(NewValue,'Target',Dim1,Dim2,DimX..,'VALUE')

Re: same cube CellGetN for a IF argument and CellPutN

Posted: Thu Jan 06, 2011 9:41 pm
by BigG
thanks, this all makes sense. cheers for response