dbTalk Databases Forums  

mdx for distinct count not working!

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


Discuss mdx for distinct count not working! in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bharati via SQLMonster.com
 
Posts: n/a

Default mdx for distinct count not working! - 05-23-2005 , 03:12 AM






I have used the below example to create distinct count calc measure in the
cube. How do I change the MDX is I need to allow the userto multiselect the
Product Names itself? The below expression returns zero if 2 product names
are selected

COUNT(CROSSJOIN({[MEASURES].[dummy]}, DESCENDANTS
([Product].CURRENTMEMBER, [Product].[Product Name])), EXCLUDEEMPTY)


thank you!

--
Message posted via http://www.sqlmonster.com

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

Default Re: mdx for distinct count not working! - 06-01-2005 , 03:11 AM






With multi-select, typically a calculated member is created on that
dimension; so hierarchy functions like DESCENDANTS
([Product].CURRENTMEMBER, [Product].[Product Name]) won't work as with
single selections.

If you can't find an easier solution, this earlier thread discusses a
virtual cube approach in a similar situation:

http://groups-beta.google.com/group/...rver.olap/msg/
92a3c5104bc46402?hl=en
Quote:
MDX function does not working with multiple selection in OWC
...
The idea of the second [StoreMap] cube is that each individual leaf
Store can be tested against the Multi-Select Calculated Member, to see
whether it is included under the selected members or not. A copy of the
[Store] dimension is needed because the Multi-Select Member is selected
on [Store] itself, so the individual Store is selected along the
identical [StoreDup] dimension. The resultant [StoreCount] is only > 0
if the tested Store is a descendant of one of the multi-select [Store]
members. So only those leaf Stores lying under the selected members are
included in the [Sales < 5K] measure calculation.
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.