Go Back   CORTEX Forums > Local Happenings > CORTEX Blogs > Random Procrastination
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

SSAS: Can I make my Distinct Count totals subtotal correctly?

This is a discussion on SSAS: Can I make my Distinct Count totals subtotal correctly? within the Random Procrastination forums, part of the CORTEX Blogs category; I've seen this question come up a couple of times. What is usually being asked is "can we make the subtotals additive for a distinct count measure?" – and the ...


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 16th February 2010, 04:16 AM   #1
Senior Member
 
Join Date: Jun 2009
Posts: 62
Darren Gosbell is on a distinguished road
Thumbs up SSAS: Can I make my Distinct Count totals subtotal correctly?

I've seen this question come up a couple of times. What is usually being asked is "can we make the subtotals additive for a distinct count measure?" – and the short answer is a resounding No!

But the short answer does not really make for a compelling blog post, so let's dig a little deeper into this issue. The more complete answer is that while there are some techniques that can make a distinct count "appear" to be additive in some circumstances, they are fundamentally flawed and will produce inconsistent results as distinct count measures are inherently non-additive.

I believe that the real issue here is not a technology issue, it is a problem with user expectations. So the correct action here is not to try to change the results, but to educate your users as to what is happening.

Let's explore this by taking a look at a simple example. The following matrix shows the products bought by two different customers over a 3 month period:

** Month** Customer 1** Customer 2*
** =====** ==========** ==========

** Jan**** Product A******* -
** Feb**** Product B*** Product C
** Mar**** Product A*** Product D


*

So, obviously over this 3 month period, there were only 2 distinct customers. However, if we group the records by month and look at the distinct count we get the following output.

** Month* Count
** =====* =====

** Jan*** 1
** Feb*** 2
** Mar*** 2


** Total* 5

*

Which, if we try to add up the distinct count measure, makes it look like, we had 5 customers, instead of 2 over the past 3 months.

Then if we look at the distinct count of customers by product over the 3 month period we get the following:

** Product*** Count
** =========* =====
** Product A* 1
** Product B* 1
** Product C* 1
** Product D* 1


** Total***** 4

*

Which someone could interpret to meaning that we actually had 4 customers over this 3 month period. Instead, what really happened is that our 2 distinct customers bought 2 different products each.*

This issue is quite easy to see with a small dataset, but with a larger dataset the results can be more subtle, but the effects will still be there. The end result of this will be that this inconsistency will cause your users to loose confidence in your solution, which is the worst thing that can happen to a BI project.

So if you ever get asked to make a distinct count measure additive, tell them "no" and feel free to point the person making the request at this blog post.






Get More from the original blog...
Darren Gosbell is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTweet this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make 10? Make 11? Let's Call the Whole Thing Off admin Prediction Markets News Feeds 0 19th November 2009 03:37 PM
"An interesting new study looks at how being able to count your ownheartbeats - the m admin Prediction Markets News Feeds 0 19th November 2009 03:37 PM
Only government bonds count as liquid assets Latest News Headlines 2009 Q4 News Headlines 0 7th October 2009 08:27 AM
The Row Count Transformation James Beresford BI Monkey 0 13th August 2009 12:51 PM
SSAS: T-SQL Equivalent for a Many-to-Many relationship Darren Gosbell Random Procrastination 0 23rd June 2009 08:30 PM


All times are GMT +11. The time now is 04:08 AM.

© The Business Intelligence Group

Search Engine Optimization by vBSEO