Page 1 of 1
Rule to Write except one element
Posted: Tue Mar 29, 2011 1:24 pm
by mail_kupi
Hi all,
i have price in january, and then i want to use rule to write price in february based on january.
this rule is in one cube.
i try to write this
['Price'] = ['Price','Jan']
is it any rule to write price except januari?
Re: Rule to Write except one element
Posted: Tue Mar 29, 2011 1:34 pm
by lotsaram
Code: Select all
['Measure':'Price'] = N:
IF( !Month @= 'Jan',
STET,
['Month':'Jan']
);
Re: Rule to Write except one element
Posted: Tue Mar 29, 2011 1:51 pm
by kpk
As far as I remember there are samples in the Rules Guide for this issue.
Try:
['Price','Jan']=STET;
['Price'] = ['Price','Jan'];
or
['Price']=IF(!month@='Jan',STET,['Jan']);
Re: Rule to Write except one element
Posted: Tue Mar 29, 2011 1:59 pm
by kpk
lotsaram wrote:Code: Select all
['Measure':'Price'] = N:
IF( !Month @= 'Jan',
STET,
['Month':'Jan']
);
... and as you can see from this code you probably need N: in the rule and a separate C: rule to calculate the average Price at C levels.
Re: Rule to Write except one element
Posted: Tue Mar 29, 2011 3:15 pm
by mail_kupi
Thanks a lot guys, it solve my problem.
i will read the Rules Guide more carefully

Re: Rule to Write except one element
Posted: Tue Mar 29, 2011 3:51 pm
by garry cook
As an aside, based on what you're asking, I would guess that your next problem is likely to be passing balances from one month to the next and feeding them correctly. General practice is to use a Last Month / Next Month pair of attributes and drive the rules and feeders off these. ie, Sales = DB('Sales',ATTRS('Month',!Month,'Last Month'); Sales => DB('Sales',ATTRS('Month',!Month,'Next Month') type of statements.
Yeah, I'm bored
