Welcome to EMC Consulting Blogs Sign in | Join | Help

Christian Wade's Blog

Distinct Count in Analysis Services 2005

A problem with the DistinctCount aggregate function for measures in Analysis Services 2000 is that it will not aggregate at leaf level if filtering only on a subset of the members in a level (or attribute).  A customer or ours is all too familiar with this limitation.  One of the enhancements to MDX in Analysis Services 2005 is that we can use sets in the where clause.  This overcomes the problem as illustrated by the following screenshots.

 

Distinct count for all members of an attribute

Distinct count for all members of an attribute

 

 

Distinct count for just 2 years aggregated at leaf level (not the sum of distinct counts for each year)

Distinct count total for just 2 years

 

 

Equivalent relational query

Equivalent relational query 

 

 

 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

christian.wade said:

Additionally, you can also use Aggregate function, visual totals mode and subselects - they will all work fine with DistinctCount measures, as well as with many-to-many dimensions, semiadditive measures, measures expressions etc.
April 6, 2005 18:08
 

christian.wade said:

Thanks for that Mosha. It is evident that MDX in Analysis Services has been massively enhanced!
April 7, 2005 16:10

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Personal Edition), by Telligent Systems