MDX Rank

Normally we use MDX Rank function to get the rank value considering just one dimension level. But I face an situation that Rank value needed to be taken considering two dimension levels. As an example needed to get the Rank of Sales value of stores, which related to a Region.
I was unable to find a direct solution and after doing some researches I was able to build the MDX query.
The query is given below.

MEMBER [Measures].[Rank] AS
{[Measures].[Rank], [Measures].[Sales]} ON 0,
{[Store—Region_Store].[Store].MEMBERS} ON 1
where {[Store—Region].[All Store—Region].[Region1]}

If we give the region value as Region1, then what this query does is it rank only the stores which are related to the Region1 region. If the Region1 region contains 5 stores, the highest rank value you will get is 5.
Hope this will help for you as well...

No comments:

Post a Comment

How the transformed data is written to an output file with column headers in U-SQL...

While working with U-SQL language, I noticed that there are few ways of writing data to an output file. Let's assume the SalesDetails....