Home Forums Reporting Services SSRS 2012 Required Each Geography Group wise product maximum sales report (Using mdx) RE: Required Each Geography Group wise product maximum sales report (Using mdx)

  • Looks like your example data is wrong. Without an explanation of the rules, this is as close as I could get:

    SELECT x.*, y.productID

    FROM

    (SELECT xState

    , MAX(Sales) AS MaxSales

    FROM salesData

    GROUP BY xState) X

    INNER JOIN salesData Y ON X.xState=Y.xState

    AND X.MaxSales=Y.Sales

    Here's the result I got:

    xStateMaxSalesproductID

    Ap80P1

    Mp70p2

    Tn50p2