Group By MDX for YTD

  • HI,

    I'm New to MDX querying, so looking for some help here :

    This is the query that got generated out of profiler :

    SELECT CROSSJOIN( { [Fiscal_Year].[2014] },

    { [Period].[Jun], [Period].[Jul] },

    { ADDCALCULATEDMEMBERS([Function].[All Function].Children) })

    ON 0 ,

    NON EMPTY CROSSJOIN( { [Fund].[10]}, { [Account_Code].[ABCD] }) ON 1

    FROM [TFA_Budget2]

    WHERE ( [Measures].[Value])

    201420142014201420142014201420142014201420142014

    JunJunJunJunJunJunJulJulJulJulJulJul

    ABCDEFABCDEF

    10ABCD102030405060102030405060

    Result Set

    201420142014201420142014

    TotalTotalTotalTotalTotalTotal

    ABCDEF

    10ABCD20406080100120

    So we total sum(A) for Jun and JUly and put it in Total.

    Thanks in advance.

  • Hi,

    Try something like this

    With Member [Period].[Total] as ( [Period].[Jun] + [Period].[Jul])

    SELECT CROSSJOIN( { [Fiscal_Year].[2014] },

    { [Period].[Total] },

    { ADDCALCULATEDMEMBERS([Function].[All Function].Children) })

    ON 0 ,

    NON EMPTY CROSSJOIN( { [Fund].[10]}, { [Account_Code].[ABCD] }) ON 1

    FROM [TFA_Budget2]

    WHERE ( [Measures].[Value])

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

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