MDX query help

  • Hello. Please help. I am new to MDX.

    I can output the table below using

    SELECT

    NON EMPTY

    {[Measures].[Cost of advertising],

    {[Measures].[Quantity sold],

    [Measures].[Revenue]

    } ON COLUMNS,

    NON EMPTY

    {([Products].[Product name].[Product name].ALLMEMBERS *

    [Customer Groups].[Group Name].[Group Name].ALLMEMBERS )

    } ON ROWS

    FROM [MySalesDW]

    ============================================================================

    Product.............Bought.By........Cost.of.advertising.....Quantity.Sold.......Revenue

    Hammer...........Carpenters.........10.........................2.......................4

    .....................Plumbers...........10.........................5.................,.....10

    .....................Masons.............10.........................1.......................2

    Screw.Driver......Carpenters.........8..........................3.......................9

    .....................Plumbers...........8..........................5......................15

    .....................Masons.............8..........................4......................12

    Chisel..............Carpenters.........12.........................2.......................2

    .....................Plumbers...........12.........................6......................6

    .....................Masons.............12.........................2......................2

    ============================================================================

    But I need an output like the table below. What query should I use? Please help. Many thanks.

    ==================================================================================

    Product.................Cost of advertising..........Quantity sold on Carpenters.........Revenue on Plumbers

    Hammer................10............................. 2........................................10

    Screw Driver...........8...............................3........................................15

    Chisel...................12............................. 2........................................6

    ==================================================================================

  • Please don't cross post. It just wastes people's time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic594505-17-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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