Calculating Avg Unit Margin @ Consolidated Levels

Post Reply
cardantim
Posts: 21
Joined: Wed May 25, 2011 1:49 pm
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2007

Calculating Avg Unit Margin @ Consolidated Levels

Post by cardantim »

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.
Margin.jpg
Margin.jpg (118.99 KiB) Viewed 2915 times


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
ajain86
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

Post by ajain86 »

In your tm1s.cfg file you have set:

AllowSeparateNandCRules=T
Ankur Jain
cardantim
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

Post by cardantim »

That appears to have addressed the problem. Added in margin % and that's fine as well. Thanks.
Post Reply