dbTalk Databases Forums  

average calculation without 0

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


Discuss average calculation without 0 in the microsoft.public.sqlserver.olap forum.



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

Default average calculation without 0 - 08-03-2006 , 02:36 AM






Hi,

I'd like to add an average calculation to my cube.

My formula is: [Measures].[Grade]/[Measures].[Grade count]

This works fine but now I'd like to exclude every grade which is a 0.
How can I do that?

Thanks!


Reply With Quote
  #2  
Old   
baty
 
Posts: n/a

Default Re: average calculation without 0 - 08-04-2006 , 03:25 AM






You can replace the count mesure with function count on a set, and use
the filter function to filter the grade with 0

Count(filter(set, [Measures].[Grade count] <> 0))

set is a set including all your members to count.


florian wrote:
Quote:
Hi,

I'd like to add an average calculation to my cube.

My formula is: [Measures].[Grade]/[Measures].[Grade count]

This works fine but now I'd like to exclude every grade which is a 0.
How can I do that?

Thanks!


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.