Rule for Attribute cube for Months with a current month flag

Post Reply
BigG
Community Contributor
Posts: 211
Joined: Tue Sep 15, 2009 11:13 pm
OLAP Product: IBMPA
Version: PA 2.0 Cloud
Excel Version: 2010

Rule for Attribute cube for Months with a current month flag

Post by BigG »

Hi, I have a Current Month flagged "Y" in my Month dim. I would like to apply logic through a rule in the attribute control cube to another attribute Act_For saying if Current Month or greater then type "F" in Act_For else "A". I also have a Month_Number I can use as an 'index' of sorts. Dont know if this is possible but if anyone has some suggestions then great...
GG
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Rule for Attribute cube for Months with a current month

Post by Martin Ryan »

I think the below should work. In pseduo code
- Set the first month to Actuals
- Write a rule so that the first month after the current month is forecast
- All other months can just be the same as whatever last month was.

I've used a "Prev" attribute, but I guess you could make your index work too. Though might not be as straightforward.

Code: Select all

# Set the very first month to 'A' manually.  Or can do via rule if you have no feeders.
['Act_For', 'Month 1] = S: stet;

['Act_For'] = S:
if(attrs('Month', attrs('Month', !Month, 'Previous'), 'CurrentMonth')@='Y', 'F',
DB('ThisCube', attrs('Month', !Month, 'Previous'), 'Act_For'));
HTH

EDIT: I should have read closer, you said the current month was forecast, not actuals. Logic still applies though...
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
BigG
Community Contributor
Posts: 211
Joined: Tue Sep 15, 2009 11:13 pm
OLAP Product: IBMPA
Version: PA 2.0 Cloud
Excel Version: 2010

Re: Rule for Attribute cube for Months with a current month

Post by BigG »

Simple as it is inthe end, it took me a couple of reads ...but I finally got it, Will give that a go, thanks Martin
GG
Post Reply