Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

What's the difference between this two MDX query?

$
0
0

There's a query from MDX Step by Step to identify the top 10 performing products by reseller sales in calendar year 2004:

Actually I just use this query to get the results -

Query I

SELECT
{([Measures].[Reseller Sales Amount])} ON COLUMNS,
TopCount(
{[Product].[Product].[Product].Members},
10,
([Measures].[Reseller Sales Amount])
) ON ROWS
FROM [Step-by-Step]
WHERE [Date].[Calendar Year].[CY 2004];

Below is the query from the book MDX Step by Step

Query II

SELECT
{([Measures].[Reseller Sales Amount])} ON COLUMNS,
TopCount(
{[Product].[Product].[Product].Members},
10,
([Measures].[Reseller Sales Amount], [Date].[Calendar Year].[CY 2004])
) ON ROWS
FROM [Step-by-Step];

The result is different.

The problem is that I think these two queries should return the same results, the reason is -

For the query I , I use a where clause to slice the cube and make sure my MDX query based on limited space which bases on the point [CY 2004] on AXIS(Hierarchy) [Date].[Calendar Year] in cube space.

For the second query, the demo use tuple ([Measures].[Reseller Sales Amount], [Date].[Calendar Year].[CY 2004]) to indicate the Reseller Sales Amount also bases on the CY 2004.

My question is what is the exact difference between this two queries ? Why we cann't use query I but have to use query II ?


Please vote if it's helpful and mark it as an answer!


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>