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 %'];
Consolidated Rules
-
- 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
Hi,
Try:
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
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 %'];
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
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
-
- Site Admin
- Posts: 1458
- Joined: Wed May 28, 2008 9:09 am
Re: Consolidated Rules
If you want to do the calculation at c and n levels, just remove the n:
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.
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 %'];
Also - you don't need to feed from both actual and salesplan. One is sufficient for a divide (or multiply) rule.
-
- 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
... 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.David Usherwood wrote:Also - you don't need to feed from both actual and salesplan. One is sufficient for a divide (or multiply) rule.

Re: Consolidated Rules
What is the upside / downside to just removing the n: as opposed to adding a c: ?David Usherwood wrote:If you want to do the calculation at c and n levels, just remove the n:
peace out,
rake
rake
-
- 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
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.erakeman wrote:What is the upside / downside to just removing the n: as opposed to adding a c: ?David Usherwood wrote:If you want to do the calculation at c and n levels, just remove the n: