Simple MDX query

  • Hi,

    I'm trying to something that I think should be straight forward in MDX but i'm struggling. I'm new to MDX so it seems trivial but may not be....

    Consider the following query:

    SELECT

    [Measures].[Thing Count] ON 0,

    YTD([Effective Date].[Year-Week].[Week].[2013 Week 6]) ON 1

    FROM

    [Cube]

    This gives me a result set that shows as per the attached. All i really want though is the SUM of the rows. How do i do that? It's driving me nuts because i'm sure it's a piece of cake.

    Thanks,

    Simon



    MCSE: Data Platform
    MCSE: Business Intelligence
    Follow me on Twitter: @WazzTheBadger
    LinkedIn Profile: Simon Osborne

  • Try something along the lines of

    With Member [Measures].[Thing Count YTD] As

    Sum(YTD([Effective Date].[Year-Week].CurrentMember)

    , [Measures].[Thing Count] )

    SELECT

    [Measures].[Thing Count YTD] ON 0,

    [Effective Date].[Year-Week].[Week].[2013 Week 6] ON 1

    FROM

    [Cube]

    Mack

  • That's great thanks!



    MCSE: Data Platform
    MCSE: Business Intelligence
    Follow me on Twitter: @WazzTheBadger
    LinkedIn Profile: Simon Osborne

  • Try this also...

    With Member [Measures].[Thing Count YTD] As

    AGGREGATE(YTD([Effective Date].[Year-Week].CurrentMember)

    , [Measures].[Thing Count] )

    SELECT

    [Measures].[Thing Count YTD] ON 0,

    [Effective Date].[Year-Week].[Week].[2013 Week 6] ON 1

    FROM

    [Cube]

    This keeps whatever it is you are counting from being double counted.

    ----------------------------------------------------

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

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