dbTalk Databases Forums  

Calculation at different level

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Calculation at different level in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Prasanna
 
Posts: n/a

Default Calculation at different level - 01-14-2004 , 06:14 AM






Hi,
Product dimension has got lowest level as SKU7
the current report has got product at Page level
and Factory dimension at Row level
There are 2 measures Plan, and production

%Total Compliance is calculated as = Min(Plan,Production)/Plan * 100
which gives correct result for Factory at row level since it is
calculated at Lowest level of Product Dimension in Cube

But if i want to calculate the Plan5 Compliance i.e at SKU5 one level
above the SKU7 of Product dimension
I was using below formula

Plan5 COmpliance % =
Sum([Product].[Category].[SKU5].members,(IIF([Measures].[Plan
Production Qty In Tons] = 0,0,IIF([Measures].[Plan Production Qty In
Tons] < [Measures].[Production Qty In Tons],[Measures].[Plan
Production Qty In Tons]/ [Measures].[Plan Production Qty In
Tons],[Measures].[Production Qty In Tons]/[Measures].[Plan Production
Qty In Tons]))* 100))

yields wrong result any one has the easiest way to calculate at
Plan5.The Product dimension is at Page level.

Please help

Regards
Prasanna

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Calculation at different level - 01-14-2004 , 12:31 PM






Averages should not be summed directly. Try this change:

Quote:
Plan5 Compliance % =
(Sum([Product].[Category].[SKU5].members,
IIF([Measures].[Plan Production Qty In Tons]
< [Measures].[Production Qty In Tons],
[Measures].[Plan Production Qty In Tons],
[Measures].[Production Qty In Tons))*100)
/([Measures].[Plan Production Qty In Tons])
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.