Consolidated Rules

Post Reply
erakeman
Posts: 10
Joined: Wed Sep 24, 2008 9:04 pm

Consolidated Rules

Post by erakeman »

Hi everyone. Full transparency, I am an FP&A guy with limited rule/feeder writing experience.
I am trying to write a rule to calculate % achievement of plan (and growth over prior year). Simple calculation (Actual \ Budget). I have the rule working fine for N level data, but figures are consolidating when I look at Total Company. How can I write the rule such that the consolidated values are not the sum of the children but rather rule generated calculations? I tried changing the N: to C: but no luck. Thought I would throw it out to the smart folks before I spin my wheels for hours.
Thanks!

SkipCheck;
[VersionMgmt:'Actual vs SalesPlan %']=N:
## only do the calculation for current budget period
If(Attrs('TimeMgmt', !TimeMgmt, 'BudFcstVar')@='Y',
([VersionMgmt:'Actual']\[VersionMgmt:'SalesPlan'])
,stet);

Feeders;
[VersionMgmt:'Actual']=>[VersionMgmt:'Actual vs SalesPlan %'];
[VersionMgmt:'SalesPlan']=>[VersionMgmt:'Actual vs SalesPlan %'];
peace out,
rake
Wim Gielis
MVP
Posts: 3239
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Consolidated Rules

Post by Wim Gielis »

Hi,

Try:

Code: Select all

SkipCheck;
## only do the calculation for current budget period
['Actual vs SalesPlan %']=N:If(Attrs('TimeMgmt', !TimeMgmt, 'BudFcstVar')@='Y',['Actual']\['SalesPlan'],stet);C:['Actual']\['SalesPlan'];

Feeders;
[{'Actual','SalesPlan'}]=>['Actual vs SalesPlan %'];
Also notice that I took out the dimension names. You can indeed include them, but with lots of rules this might be too much text.
Make sure rules-calculated elements are unique over dimensions in your cube, if not you can still add the dimension names. But when you do so, do not forget the single quotes around the dimension name !

Wim
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: Consolidated Rules

Post by David Usherwood »

If you want to do the calculation at c and n levels, just remove the n:

Code: Select all

SkipCheck;
['Actual vs SalesPlan %']=
## only do the calculation for current budget period
If(Attrs('TimeMgmt', !TimeMgmt, 'BudFcstVar')@='Y',
(['Actual']\['SalesPlan'])
,stet);

Feeders;
['SalesPlan']=>['Actual vs SalesPlan %'];
I'm glad you are using n: as lots of newbies miss it. But this is a case where you shouldn't. I describe this type of rule as KPI rules - you are dividing a line by another line and you want it all the way up the hierarchies.
Also - you don't need to feed from both actual and salesplan. One is sufficient for a divide (or multiply) rule.
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Consolidated Rules

Post by lotsaram »

David Usherwood wrote:Also - you don't need to feed from both actual and salesplan. One is sufficient for a divide (or multiply) rule.
... well actually you may not need to feed at all unless there is a requirement for the KPI measure to display in a null suppressed view. ;)
erakeman
Posts: 10
Joined: Wed Sep 24, 2008 9:04 pm

Re: Consolidated Rules

Post by erakeman »

David Usherwood wrote:If you want to do the calculation at c and n levels, just remove the n:
What is the upside / downside to just removing the n: as opposed to adding a c: ?
peace out,
rake
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Consolidated Rules

Post by lotsaram »

erakeman wrote:
David Usherwood wrote:If you want to do the calculation at c and n levels, just remove the n:
What is the upside / downside to just removing the n: as opposed to adding a c: ?
If you want to apply the same rule to both leaf and consolidated elements then simply don't use a qualifier. Use separate N: and C: qualifiers if you want to apply a different calculation depending on whether the cell is simple or consolidated.
Post Reply