Testing for current month and prior month
Posted: Fri Oct 14, 2011 9:27 am
I've not been able to figure out a way of doing this so thought I'd see if someone has a smart way of doing this.
The problem
In a rule set I need to test if the period in the rule space is equal to the current or the prior month as set in another cube. This is trivial to do with two logic tests.
i.e.
In an effort to make my rules more efficent though I'd like to achieve the same logic using a single logic test so I don't have to repeat the lookup to the current month cube. The DB to the where the current month is held contains two other DBs in my actual system which is why I think its worth making the effort and I need to use the above logic to condionalise all my feeders.
The above comes close but doesn't work when the current month is 201101 for example.
The problem
In a rule set I need to test if the period in the rule space is equal to the current or the prior month as set in another cube. This is trivial to do with two logic tests.
i.e.
Code: Select all
[]=N: If ( Numbr (!Year | !Month ) = DB ( ref to current month setting) % Numbr (!Year | !Month ) = DB ( ref to prior month setting), etc
Code: Select all
[]=N: If ( MOD ( DB ( ref to current month setting) , Numbr (!Year | !Month ))<=1 , etc