Rules

Post Reply
Santiago
Posts: 13
Joined: Fri Jul 30, 2010 2:18 pm
OLAP Product: TM1
Version: TM1 9.5
Excel Version: Excel 2003

Rules

Post by Santiago »

Hi,
I want to write a rule that calculates the amount (price) of a product according to the previous period's price multiplied by the percentage increase in his current term.
I want that element Medidas_Precio Amount of dimension can only type in the value of the initial period. Also will be able to type in the values of the percentages. Therefore, I want to write the rule would give me the rest of the values of the following months.
I put this rule does not work: ['Importe']=N:DB('Precios',DIMNM('Periodos',(DIMIX('Periodos',!Periodos)-1)),!ProductsDimension,!Versiones,!Year,!Medidas_Precio)*['Porcentaje','Forecast'];
You can do the following but I do it only in a formula:
#['Importe','Jan']=['Importe','Período Inicial']*['Porcentaje','Jan'];

#['Importe','Feb']=['Importe','Jan']*['Porcentaje','Feb'];

#['Importe','Mar']=['Importe','Feb']*['Porcentaje','Mar'];

#['Importe','Abr']=['Importe','Mar']*['Porcentaje','Abr'];

#['Importe','May']=['Importe','Abr']*['Porcentaje','May'];

#['Importe','Jun']=['Importe','May']*['Porcentaje','Jun'];

#['Importe','Jul']=['Importe','Jun']*['Porcentaje','Jul'];

#['Importe','Ago']=['Importe','Jul']*['Porcentaje','Ago'];

#['Importe','Sep']=['Importe','Ago']*['Porcentaje','Sep'];

#['Importe','Oct']=['Importe','Sep']*['Porcentaje','Oct'];

#['Importe','Nov']=['Importe','Oct']*['Porcentaje','Nov'];

#['Importe','Dec']=['Importe','Nov']*['Porcentaje','Dec'];

I present an image that represents a little of what I'm doing.
Dibujo.JPG
Dibujo.JPG (44.69 KiB) Viewed 3120 times

Thank you very much
Regards
AWILDE
Posts: 28
Joined: Wed Sep 16, 2009 4:33 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003

Re: Rules

Post by AWILDE »

Hi,

In order to look at the prior period you can set up an attribute for your time dimension called "prior_period" and type in the prior period element names.

You can then write a rule to refer to that attribute as follows:

ATTRS('Time',!Time,'prior_period')
Neil Watson
Posts: 32
Joined: Wed May 28, 2008 11:41 am
OLAP Product: TM1
Version: 6 and 2.5 to 10.2.2
Excel Version: 2007 2010
Location: Northern England
Contact:

Re: Rules

Post by Neil Watson »

Santiago,

You have the right idea, but it can be made so much easier by using attributes on the dimension instead of DIMIX and DIMNM.
In Server Explorer, Select dimension Periodos, right click edit element attributes
Select Edit-> Add New attribute, selct Text, call it Previous and another called Next

Previous
Jan = Periodo Inicial
Feb = Jan
Mar = Feb
Abr = Mar
etc

Next
Periodo Inicial = Jan
Jan = Feb
Feb = Mar
etc

then your rules,

['Importe', 'Periodo Inicial'] = stet; #this allows for input
['Importe'] = N: ['Porcentaje'] * DB('Precios', attrs('Periodos', !Periodos, 'Previous'), !Versiones, !Year !Medidas_Precio);


feeders;
['Importe','Periodo Inicial'] => DB('Precios', attrs('Periodos', !Periodos, 'Next'), !Versiones, !Year !Medidas_Precio);
#This feeder only works fully if you have a value in Periodo Inicial and no breaks in the data e.g. May = 0
or you'll have to feed the whole year
['Importe', 'Periodo Inicial'] =>
['Jan'],
['Feb'],
['Mar']....

or
['Importe','Periodo Inicial'] => ['Full Year']; # although it's better to try to not feed consolidations points to avoid over feeding

HTH
Neil
Santiago
Posts: 13
Joined: Fri Jul 30, 2010 2:18 pm
OLAP Product: TM1
Version: TM1 9.5
Excel Version: Excel 2003

Re: Rules

Post by Santiago »

Thank you very much for the answers. But I think the following rule solves a lot better this example:
['Importe', 'Periodo Inicial'] = stet;
['Importe','Forecast','2010']=N:DB('Precios2',DIMNM('Periodos2',DIMIX('Periodos2',!Periodos2)-1),
!ProductsDimension,!Versiones,!Year,'Importe')*['Porcentaje'];
At the end I think I could do.

Regards
Post Reply