dbTalk Databases Forums  

solve order & calculated measure

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


Discuss solve order & calculated measure in the microsoft.public.sqlserver.olap forum.



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

Default solve order & calculated measure - 02-10-2004 , 07:02 AM






Hi.

I'm new in OLAP and maybe this is a silly question but...

I Have Cube with a few measures, and 2 of them are
Quantity, AvgPrice and Money.

Quantity is calculated measure.
AvgPrice is also calculated measure.
Money is also calculated measure and
Money=Quanity*AvgPrice;

The Cube give the results:

Quote:
Quantity | AvgPrice | Money |
-------------------------------------
1 | 2 | 8 | 16 |
2 | 20 | 10 | 200 |
3 | 10 | 9 | 90 |
-------------------------------------
total | 32 | 9 | 288 |
-------------------------------------

Total Quantity and total AvgPrice are OK because Quantity should
return SUM() and AvgPrice should return Avg().
But the money is incorrect because it returns 32*9=288 instead of
16+200+90=306
I tryed to change "Solve order" property but nothing change.
Please help me solving this prolem.

Thanks.


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

Default Re: solve order & calculated measure - 02-10-2004 , 01:52 PM






Solve orders will not solve your problem - the MDX definition for Money
should incorporate a roll-up of leaf-level values, per your requirement.
See this post:

http://groups.google.com/groups?hl=e...8&selm=eD4CYDF
7DHA.1596%40TK2MSFTNGP10.phx.gbl
Quote:
From: Deepak Puri (deepak_puri (AT) progressive (DOT) com)
Subject: Re: Help with MDX query solve order
View: Complete Thread (2 articles)
Original Format
Newsgroups: microsoft.public.sqlserver.olap
Date: 2004-02-05 17:32:08 PST


The problem does not lie in solve orders, rather in how
[Statistic].[Sales].[Net Proj] is defined, since it does not sum up the
contributions for each outlet. Try this:

Quote:
Member [Statistic].[Sales].[Net Proj] as
'Sum(Descendants([Outlets],CurrentMember,,LEAVES),
(StatDate.[2004].[1], [Statistic].[Sales].[Net TRGT],
[Measures].[Value]) *
(StatDate.[2004].[1].[5],
[Statistic].[Sales].[Net Act] , [Measures].[QTD]) /
(StatDate.[2004].[1].[5], [Statistic].[Sales].[Net TRGT],
[Measures].[QTD]))', solve_order = 4, format = '0'
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.