Calculated member problem -> to show Full year data for each month

  • Hi,

    I do have a following problem:

    Time dimension with hierarchy [Time].[Year - Month] with levels Year and Month and some measures.

    For example calculated measure YTD:

    CREATE MEMBER CURRENTCUBE.[Measures].[YTD]

    AS AGGREGATE(

    YTD([Time].[Year - Month].CurrentMember)

    ,[Measures].[Value]),

    FORMAT_STRING = "#,##0.00;-#,##0.00",

    VISIBLE = 1 , DISPLAY_FOLDER = 'Calculated measures';

    But I need to create a calculated measure [FY] which would show Full Year data for each month (meaning it would be constant for each month within one year).

    Does anyone has any idea?

    I would really appreciate it.

    Ondra

  • Are you saying that each month column needs to show data for the current month AND the previous 11 months; or, does the number of "previous months of data to display" vary for each month column in your cellset? If you just need to show the last 11 months along with the current month, I would go with the RANGE OPERATOR (:) combined with LAG(11).

    For example in Adventure Works:

    SUM(

    [Date].[Month Name].CurrentMember.Lag(11) :

    [Date].[Month Name].CurrentMember,

    [Measures].[Internet Sales Amount]

    )

    ,

    FORMAT_STRING = “Currency”,

    VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = ‘Internet Sales’;

  • Thx a lot for your answer.

    I finally managed this way:

    CREATE MEMBER CURRENTCUBE.[Measures].[Full Year]

    AS AGGREGATE(

    ANCESTOR( [Time].[Year - Month].CurrentMember,[Time].[Year - Month].[Year] ), [Measures].[Value]),

    FORMAT_STRING = "#,##0.00;-#,##0.00",

    VISIBLE = 1 , DISPLAY_FOLDER = 'Calculated measures' , ASSOCIATED_MEASURE_GROUP = 'Line Items' ;

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

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