Hello,
I've successfully established avg price and avg cost for a price and cost cube at the C level. However, stuck on how to calculate margin at the C level.
Not not sure if it helps but I've attached an image of the screen.
Below are my rules;
SKIPCHECK;
#Calculate Unit Sale Price for consolidated levels
['UnitPrice_hold']=N:['Unit Sale Price'];
['UnitPrice_count']=N: IF(['Unit Sale Price'] <> 0,1,0);
['Unit Sale Price']=C:['UnitPrice_hold'] \ ['UnitPrice_count'];
#Calculate Average Unit Cost for consolidated levels
['UnitCost_hold']=N:['Unit Cost'];
['UnitCost_count']=N: IF(['Unit Cost'] <> 0,1,0);
['Unit Cost']=C:['UnitCost_hold'] \ ['UnitCost_count'];
#Calculate Unit Margin and Unit Margin %
['Unit Margin']=N:['Unit Sale Price']-['Unit Cost'];
['Unit Margin %']=N:['Unit Margin']/['Unit Sale Price'];
#Calculate Average Unit Margin
['UnitMargin_hold']=N:['Unit Margin'];
['Unit Margin']=C:['Unit Sale Price']-['Unit Cost'];
Feeders;
['Unit Sale Price']=>['UnitPrice_hold'],['UnitPrice_count'];
['Unit Cost']=>['UnitCost_hold'],['UnitCost_count'];
['Unit Margin']=>['UnitMargin_hold'];
['Unit Sale Price']=>['Unit Margin'];
['Unit Cost']=>['Unit Margin'];
['Unit Margin']=>['Unit Margin %'];
Thanks
Calculating Avg Unit Margin @ Consolidated Levels
-
- Community Contributor
- Posts: 132
- Joined: Thu Oct 15, 2009 7:45 pm
- OLAP Product: TM1
- Version: 9.4.1 9.5 9.5.1
- Excel Version: 2003 2007
Re: Calculating Avg Unit Margin @ Consolidated Levels
In your tm1s.cfg file you have set:
AllowSeparateNandCRules=T
AllowSeparateNandCRules=T
Ankur Jain
-
- Posts: 21
- Joined: Wed May 25, 2011 1:49 pm
- OLAP Product: TM1
- Version: 9.5.1
- Excel Version: 2007
Re: Calculating Avg Unit Margin @ Consolidated Levels
That appears to have addressed the problem. Added in margin % and that's fine as well. Thanks.