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])

    2014 2014 2014 2014 2014 2014 2014 2014 2014 2014 2014 2014

    Jun Jun Jun Jun Jun Jun Jul Jul Jul Jul Jul Jul

    A B C D E F A B C D E F

    10 ABCD 10 20 30 40 50 60 10 20 30 40 50 60

    Result Set

    2014 2014 2014 2014 2014 2014

    Total Total Total Total Total Total

    A B C D E F

    10 ABCD 20 40 60 80 100 120

    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