Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

How to List Years , without non-empty month measure value

$
0
0
hi all ,I want to list years has data for all the month[1 to 12]. Exclude the year if there is no data for any of the month[1 to 12] there is no data.e.g. [Month of Year 2011] Measure.val1 10 2 20 3 304 405 506 607 708 809 90 10 100 11 110 12 120[Year of 2012] Measure.val1 10 2 20 3 304 NULL5 506 607 708 NULL9 90 10 100 11 110 12 NULL[b]Ans[/b] : List on 2011 , Capacity 780 #excluded the year 2012I am trying around the MDX below please suggest how can i batter achieve it.WITHMEMBER [MEASURES].[Monthly Moving Avg]AS 'IIF( [Dim Date].[Calendar Hierarchy].CURRENTMEMBER.LEVEL.ORDINAL = [Dim Date].[Calendar Hierarchy].[Year].ORDINAL, AVG(LASTPERIODS (6, [Dim Date].[Calendar Hierarchy].CURRENTMEMBER), [Measures].[Generation]), NULL)', FORMAT_STRING = "$#,##0;0;0;\N\\\A\"SELECT {[Measures].[OutPut], [MEASURES].[Monthly Moving Avg]} ON AXIS (0), {DESCENDANTS([Dim Date].[Calendar Hierarchy].[Year].allmembers, [Dim Date].[Calendar Hierarchy].[Year] , self_and_before )} ON AXIS(1) FROM [mycube]

Viewing all articles
Browse latest Browse all 1341

Trending Articles