dbTalk Databases Forums  

most frequent value of measure ?

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


Discuss most frequent value of measure ? in the microsoft.public.sqlserver.olap forum.



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

Default most frequent value of measure ? - 07-14-2005 , 10:57 AM






Hi,

I have the following data:

Qty
---
2005, Jan | 100
2005, Feb | 110
2005, Mar | 120
2005, Apr | 100
2005, May | 90

and I'd like a MDX query returning the most frequent value of measure
Qty, 100 here. I have found a really ugly way (involving a new
dimension!) but I'm not really proud of it and, more important, it's
quite slow !! Any help ?

Reply With Quote
  #2  
Old   
SQL McOLAP
 
Posts: n/a

Default RE: most frequent value of measure ? - 07-14-2005 , 03:07 PM






It looks like you're asking for the mode. Unfortunately, there's no Mode
function in native MDX. Another problem you're faced with what to do when
your set has more than one mode, which is possible. What's your criteria for
breaking the tie? With an answer to this, it might be easier to find a way
to approach this.

- Phil

"Ethan" wrote:

Quote:
Hi,

I have the following data:

Qty
---
2005, Jan | 100
2005, Feb | 110
2005, Mar | 120
2005, Apr | 100
2005, May | 90

and I'd like a MDX query returning the most frequent value of measure
Qty, 100 here. I have found a really ugly way (involving a new
dimension!) but I'm not really proud of it and, more important, it's
quite slow !! Any help ?


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.