MDX Question

  • How to get the member at highest level from a set of members ?

    Is there a function for that ?

    BI Developer
    SSRS, SSIS, SSAS, IBM Cognos, IBM Infosphere Cubing services, Crystal reports, IBM DB2, SQL Server, T-SQL
    Please visit... ApplyBI

  • 1) SELECT Measures.MEMBERS ON COLUMNS,

    HEAD(ORDER({[Store].[Store City].MEMBERS},

    Measures.[Sales Count], BDESC), 12) ON ROWS

    FROM [Sales]

    2) TAIL

    3) SELECT Measures.MEMBERS ON COLUMNS,

    TOPCOUNT({[Store].[Store City].MEMBERS}, 12,

    Measures.[Sales Count]) ON ROWS

    FROM [Sales]

    4) TOPCOUNT

    Are some of The functions can be used to get TOP N and Bottom N Values.

  • vineet_dubey1975 (5/31/2011)


    1) SELECT Measures.MEMBERS ON COLUMNS,

    HEAD(ORDER({[Store].[Store City].MEMBERS},

    Measures.[Sales Count], BDESC), 12) ON ROWS

    FROM [Sales]

    2) TAIL

    3) SELECT Measures.MEMBERS ON COLUMNS,

    TOPCOUNT({[Store].[Store City].MEMBERS}, 12,

    Measures.[Sales Count]) ON ROWS

    FROM [Sales]

    4) TOPCOUNT

    Are some of The functions can be used to get TOP N and Bottom N Values.

    Head and Tail are of no use here as they blindly return the 1st and last member resp.

    And Topcount returns a set or member based on a value.

    (Ex. We can use Topcount for getting Top sellers in an area.)

    What i want is if a set like this

    {[Geography].[Country].&[India].&[Maharashtra].&[Mumbai], [Geography].[Country].&[India], [Geography].[Country].&[India].&[Maharashtra]}

    exists then

    a function should return a single member as

    [Geography].[Country].&[India]

    which is the highest level.

    Regards,

    Amar Sale

    BI Developer
    SSRS, SSIS, SSAS, IBM Cognos, IBM Infosphere Cubing services, Crystal reports, IBM DB2, SQL Server, T-SQL
    Please visit... ApplyBI

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

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