Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Calculated member problem -> to show Full year data for each month Expand / Collapse
Author
Message
Posted Wednesday, March 5, 2014 1:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, May 6, 2014 3:14 AM
Points: 2, Visits: 10
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




Post #1547661
Posted Thursday, March 6, 2014 10:34 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, March 27, 2014 2:39 PM
Points: 2,141, Visits: 486
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’;

Post #1548391
Posted Thursday, March 13, 2014 7:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, May 6, 2014 3:14 AM
Points: 2, Visits: 10
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' ;
Post #1550693
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse