Need Simlpe Clarification in MDX

  • I had a reqier ment as shown

    Hierarchy Country.States.City and the measure in Population

    I need to get top 5 countries and top 5 States . By using Population as Measure How can i get it.

    ....

    Second one

    I am getting #error only at AllSum(total) in my report I headrd that Summing Nulls with 0 is the cause for that is there any other reasons for that

  • Run using something like

    SELECT [Measures].[POPULATION] ON ROWS,

    Topcount([Hierachy].[Country States].[City],5,[Measures].[POPULATION]) on Columns,

    FROM [YOURCUBE]

  • Run following query

    Select [Measures].[Population] ON Columns,

    Topcount ([Hierachy].[Country States].[City].Members, 5, [Measures].[Population]) on Rows

    From [Cube]

    Use NonEmpty function to resolve the Second Query nd let me know

  • bhushan_juare (8/28/2011)


    Run following query

    Select [Measures].[Population] ON Columns,

    Topcount ([Hierachy].[Country States].[City].Members, 5, [Measures].[Population]) on Rows

    From [Cube]

    Use NonEmpty function to resolve the Second Query nd let me know

    Isn't that exactly what I had put?!? ha!

  • I think, u didn't.

  • This will return the top 5 populous countries sorted in DESC order, followed by the top 5 States/Provinces (in the world) in the same DESC order.

    SELECT [measures].[population] on Columns,

    {SUBSET(ORDER([heirarchy].[states].members, [measures].[population], BDESC),0,5)

    , SUBSET(ORDER([heirarchy].[country].members, [measures].[population], BDESC),0,5)

    } on Rows

    FROM [cube]

Viewing 6 posts - 1 through 5 (of 5 total)

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