dbTalk Databases Forums  

Calculating averages in a cube

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


Discuss Calculating averages in a cube in the microsoft.public.sqlserver.olap forum.



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

Default Calculating averages in a cube - 12-21-2005 , 03:21 PM






My users want a cube that has average ratings. The cube I've developed has
sums of the individual ratings. I tried inserting a calculated measure, but
I could not get the AVG function to parse properly.

Eventually, these cubes will be displayed in pivot tables in Excel.
Apparently, when using an OLAP cube in Excel, one cannot add calculated
fields.

How can I include the average ratings in my cube.

TIA,

Mike

Reply With Quote
  #2  
Old   
Gary Gibbs
 
Posts: n/a

Default Re: Calculating averages in a cube - 12-21-2005 , 03:49 PM






In your fact table, create a column that returns a 1 or 0 (call
ReviewCount) depending if it should be counted in the denominator. Now
you have the ratings as the numerator and ReviewCount as the
denominator. Create a calculated member as Ratings/ReviewCount. Excel
will see this a just another measure.


Reply With Quote
  #3  
Old   
Mike Austin
 
Posts: n/a

Default Re: Calculating averages in a cube - 01-04-2006 , 05:30 PM



Hi,

This appears to work most of the time. However, I have a cube that shows
several averages of ~ 15, even though the highest possible rating is 7. This
either is clearly a bug or there is a problem with my calculation. Here is
the calculation:

[Measures].[Rating]/[Measures].[Count Column]

[Count Column] always equals 1.

TIA,

Mike

"Gary Gibbs" wrote:

Quote:
In your fact table, create a column that returns a 1 or 0 (call
ReviewCount) depending if it should be counted in the denominator. Now
you have the ratings as the numerator and ReviewCount as the
denominator. Create a calculated member as Ratings/ReviewCount. Excel
will see this a just another measure.



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.