dbTalk Databases Forums  

Custom MDX Distinct Count

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


Discuss Custom MDX Distinct Count in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
davids@thorntonsinc.com
 
Posts: n/a

Default Custom MDX Distinct Count - 09-06-2006 , 12:05 PM






We have a cube with the following dimensions and measures:
Dimension called: Card Number
Dimension called: Transaction Type
With Levels: Load, Redeem, Unknown
Measure Called: Transaction Count
Is there a way to write a calculated measure to return the following?
The Distinct count of cards that have between 2 and 4 "load" transactions
and at least 1 "redeem" transaction

Note: We are using Analysis Services 2000, but are planning to move AS2005
soon

Thanks


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

Default Re: Custom MDX Distinct Count - 09-07-2006 , 12:52 AM






Assuming that each leaf member of the Card Number dimension represents a
distinct card, and that what you meant by "With Levels: Load, Redeem,
Unknown" was actually members, not levels of the Transaction Type
dimension:

Count(Filter([Card Number].[Card Number].Members,
([Measures].[Transaction Count],
[Transaction Type].[Load]) >= 2 And
([Measures].[Transaction Count],
[Transaction Type].[Load]) <= 4 And
([Measures].[Transaction Count],
[Transaction Type].[Redeem]) >= 1))


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