Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Distinct Count Measure Group not distinct in MDX script


Distinct Count Measure Group not distinct in MDX script

Author
Message
ericlgagne
ericlgagne
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 34
I am attempting run the following MDX query to determine the distinct amount of transaction numbers for a set including 2 dimension attributes. (POS and Concierge) When I run the query, I seem to be getting the distinct amounts for each added to together. If the same transaction number exists in both, they are both counted. However if I attempt to get the same result using an Excel Pivot table, I get the desired transaction number count. Could anyone help me with getting this result in the MDX query?

WITH

SET [Week] AS StrToMember("[Date].[Hierarchy - Fiscal].[Fiscal Week].&[2012]&[48]")

SET [Store] AS {[Financial Transaction Channel].[Transaction Channel Desc].&[POS],
[Financial Transaction Channel].[Transaction Channel Desc].&[CONCIERGE]}



MEMBER [Store Transactions With Returns] AS SUM([Week] * [Store], [Measures].[Operational Transactions Count])


SELECT
{
[Store Transactions With Returns]
} ON COLUMNS,
{
[Week]
} ON ROWS
FROM EDW

Results: Store Transactions With Returns
Wk. 48 - 2012 78,636



The same attempt using an Excel Pivot table yields this:

Row Labels   Operational Transactions Count   
Year 2012 78,368
Half 2 - 2012 78,368
Qtr. 4 - 2012 78,368
December - 2012 78,368
Wk. 48 - 2012 78,368 Result of addition: 78,636
1 US STORES 78,368
CONCIERGE 3,668
POS 74,968
Grand Total 78,368



If you add the POS and Concierge amounts, you get 78,636. Which is the same result I am getting from my MDX query, but after I went through the transactions line by line, I was able to determine that 78,368 is the correct amount of distinct transaction numbers.


Any help on this would be greatly appreciated.
Mackers
Mackers
SSC-Enthusiastic
SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)

Group: General Forum Members
Points: 117 Visits: 499
Try this and let me know if it works


SELECT
{ [Measures].[Operational Transactions Count]} ON COLUMNS,
{ [Date].[Hierarchy - Fiscal].[Fiscal Week].&[2012]&[48]} ON ROWS
FROM
(SELECT {[Financial Transaction Channel].[Transaction Channel Desc].&[POS],
[Financial Transaction Channel].[Transaction Channel Desc].&[CONCIERGE]} ON COLUMNS
FROM EDW)



Mack
ericlgagne
ericlgagne
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 34
I ended up creating a new dataset and basically using what you describe above. When the dimension attributes are placed in the WHERE clause, it works.

Thanks for your feedback.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search