Page 1 of 1

Calculating Avg Unit Margin @ Consolidated Levels

Posted: Wed May 25, 2011 4:34 pm
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 3385 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

Re: Calculating Avg Unit Margin @ Consolidated Levels

Posted: Wed May 25, 2011 5:59 pm
by ajain86
In your tm1s.cfg file you have set:

AllowSeparateNandCRules=T

Re: Calculating Avg Unit Margin @ Consolidated Levels

Posted: Wed May 25, 2011 8:13 pm
by cardantim
That appears to have addressed the problem. Added in margin % and that's fine as well. Thanks.