MDX rank rownumber function

  • I have an existing SSRS report out of T-sql query and I am trying to recreate it using MDX queries on SSAS cube. I am stuck with rewriting Row_number and rank logic to MDX .

    In the SQL, It is written as :
    SELECT ceil((ROW_NUMBER() OVER (PARTITION BY PRODUCT ORDER BY YEARMONTH))/12) Rank1 in the SQL. Can someone tell me if this can be done using MDX? In the cube, PRODUCT and YEARMONTH are coming from separate dimensions.

    Thank you for your help!

  • Try the rank() MDX function. Reference available here: https://docs.microsoft.com/en-us/sql/mdx/rank-mdx

  • Thank you. I am able to get the rank function for each record but I need the same number to be displayed for the first 12 YEARMONTHs within a product.

    Can you suggest me how to do that please?

  • Please post your MDX query along with your results and what the expected results are.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply