I have a problem when I write scopes statement to calculate Calendar Year-To-Date Values in cube using SSAS.Here is my Date Dimension and its hierarchy: enter image description here enter image description here[img]http://i593.photobucket.com/albums/tt19/hieupm_it90/c2.png[/img][img]http://i593.photobucket.com/albums/tt19/hieupm_it90/c1.png[/img]In measures group, I have a measure named [Sales Amount] which is the sales amount of each item in date. I want to calculate year-to-date value. Here is my scope statement but it don't work well.[quote]SCOPE(MEASURES.[YTD Sales]); --Calendar YTD SCOPE([DimDates].[Year-Qtr-Month-Day].MEMBERS, [DimDates].[Year].[Year].MEMBERS); THIS = AGGREGATE( PERIODSTODATE([Date].[Year].[Year], [Date].[Year].CURRENTMEMBER), [Measures].[Sales Amount]); END SCOPE; END SCOPE;[/quote]Thanks for any suggestion.
↧