dbTalk Databases Forums  

Agregate in Calculated Members

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


Discuss Agregate in Calculated Members in the microsoft.public.sqlserver.olap forum.



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

Default Agregate in Calculated Members - 11-06-2003 , 08:49 PM







Hi,

I am a newbie in OLAP world.

I am having problem in counting weighted average.

I have a fact table consist of Volume,Tax and etc.

The fact table is actually Sales Volume of all company in country.

I have also Brand, Company as dimension table.



What I did is to create Relative Contribution to Total Industry by
creating following calculated measure:



ContribBrandToTotal:

[Measures].[Volume] / ([Measures].[Volume],[Brand].[All Brand])



ContribCompanyToTotal:

[Measures].[Volume] / ([Measures].[Volume],[Company].[All Company])



ContribBrandToCompany:

[ContribBrandToTotal]/[ContribCompanyToTotal]



To Calculate Weighted Average of Brand Tax Rate to Company,

I simply create:

[Measures].[Tax]*[ContribBrandToCompany]



I got right leave values. I expect the leaves values to be sum up at
company level to get The Weighted Average.

But I found It did not sum up.

Anyone can help me on this?

Or any other way to calculate Weighted Average?



Thx


--
Posted via http://dbforums.com

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

Default Re: Agregate in Calculated Members - 11-07-2003 , 10:19 PM






Typically, a weighted average requires an additional measure (with 'sum'
aggregation function), which can efficiently aggregate the weighted leaf
values. Otherwise the leaf values have to be aggregated on the fly. Can
you provide some simple sample data that illustrates how you want the
weighted average to work - it's not obvious?

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