Returning Top 20% of Products based on Sales

  • Hi

    As the subject says I am interested in populating a SET with the 20% best selling products.

    I tried the TOPPERCENT, but then I get the cumulative 20%.

    I pretty new to MDX and need some guidence:).

    Thanks Michael

  • If you new in MDX you need this book

    http://www.amazon.com/MDX-Solutions-Microsoft-Analysis-Services/dp/0471748080/ref=sr_1_1?ie=UTF8&s=books&qid=1228303173&sr=1-1

    WITH

    MEMBER [Measures].[Top Product in Children] AS

    TopCount (

    [Product].[ByCategory].CurrentMember.Children,

    1,

    [Measures].[Unit Sales]

    ).Item(0).Item(0).Name

    MEMBER [Measures].[Top Product’s Units] AS

    ( [Measures].[Unit Sales],

    TopCount (

    [Product].[ByCategory].CurrentMember.Children,

    1,

    [Measures].[Unit Sales]

    ).Item(0) // in Essbase, need .Item(0).Item(0)

    )

    SELECT

    CrossJoin (

    { [Time].[YQMD].Children }.

    { [Measures].[Top Product in Children],

    [Measures].[Top Product’s Units]

    }

    ) on columns,

    { [Customer].[Customer].[Region].Members } on rows

    FROM Sales

  • Hi

    I got the book 🙂

    My understanding in MDX i still a little vague;)

    I solved the issue with Order and Topcount.

    Thanks

    Michael

  • 😎

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

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