Attribute as Y/N flag in Allocation process

Post Reply
conflax
Posts: 47
Joined: Thu Jun 07, 2012 10:20 am
OLAP Product: TM1
Version: Various
Excel Version: Various
Location: UK

Attribute as Y/N flag in Allocation process

Post by conflax »

Hi,

I am building a TI process to perform a straightforward Allocation in a P&L cube. I need to be able to allocate Investment Income across different Scheme codes (Investment Income being an element in a dimension "Nominal", and "Scheme" being another dimension with 60+ elements).

By default my values go to one Scheme code and I am using an Attribute to define the allocation basis (GWP, Costs etc) and spread the income - this bit works fine.

What I want to be able to do is NOT allocate to certain Schemes. I have setup an Attribute "Alloc Investment Income" which is a Y/N flag against each Scheme Element and have tried to put in an IF statement to basically say :-

IF Attribute is Y
Do the allocation
Otherwise leave as is

However this does nothing. The TI runs successfully but no allocation is carried out. Playing with the values in the Y/N field does not appear to help. I have tried to remove any possible issue with consolidated elements by putting in the ELLEV in case that was the problem but no luck there.

Here is my TI code below. Hopefully I am just doing something stupid! Can you help please? Let me know if you need any more info.

Thanks
Steve



s_CubeName='Reporting_Scheme';
s_DimName='Scheme';
s_AllocBasis = ATTRS('Nominal',Nominal,'Allocation Basis');


n_TotalValue=CellGetN(s_CubeName,Version,'All Acc Years','All Lines',Company,'All Cover Types','All Products','All Schemes',s_AllocBasis,v_Period,
v_Year);

n_Limit=DIMSIZ(s_DimName);
n_Counter=1;

WHILE(
n_Counter<=n_Limit);
s_ElementName=DIMNM(s_DimName,n_Counter);

IF(
ELLEV(s_DimName,s_ElementName)=0);
IF(ATTRS('Scheme',Scheme,'Alloc Investment Income')@='Y');

n_SchemeValue= CellGetN(s_CubeName,Version,'All Acc Years','All Lines',Company,'All Cover Types','All Products',s_ElementName,s_All
ocBasis,v_Period,v_Year);

n_Ratio=n_SchemeValue\n_TotalValue;

CellPutN(n_Ratio, 'Reporting_Scheme', Version,v_AccidentYear,LineOfBusiness,Company,v_CoverType,Product,s_ElementName,s_allocBasis|
'%',v_Period,v_Year);

n_AllocValue=n_Ratio*Value;

CellPutN(n_AllocValue, 'Reporting_Scheme', Version,v_AccidentYear,LineOfBusiness,Company,v_CoverType,Product,s_ElementName,Nominal,
v_Period,v_Year);

ENDIF;
ENDIF;

n_Counter=n_Counter+1;
END;
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Attribute as Y/N flag in Allocation process

Post by tomok »

IF(ATTRS('Scheme',Scheme,'Alloc Investment Income')@='Y');

Where is the variable Scheme defined????? Shouldn't this be:

IF(ATTRS('Scheme',s_ElementName,'Alloc Investment Income')@='Y');
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
conflax
Posts: 47
Joined: Thu Jun 07, 2012 10:20 am
OLAP Product: TM1
Version: Various
Excel Version: Various
Location: UK

Re: Attribute as Y/N flag in Allocation process

Post by conflax »

(sound of flat hand hitting forehead)

Thanks very much tomok

I suspected it would be a schoolboy syntax error somewhere

Works fine now
Cheers
Post Reply