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

Using a SET in a Previous Year Calculation

$
0
0
Hi everyoneMy MDX skills aren't the greatest so I'm battling with the following query:[code="sql"] WITH SET [ATL] AS { [Income Statement].[Income Statement Lines].[IS Level4].&[71], [Income Statement].[Income Statement Lines].[IS Level4].&[74]} MEMBER [Measures].[ATL] AS SUM((PeriodsToDate([Date].[Financial Dates].[Financial Year], [Date].[Financial Dates].CURRENTMEMBER), ([ATL], [Measures].[Value]))) MEMBER [Measures].[PYATL] AS SUM(PeriodsToDate([Date].[Financial Dates].[Financial Year], ParallelPeriod([Date].[Financial Dates].[Financial Year], 1, [Date].[Financial Dates].CURRENTMEMBER)), ([ATL], [Measures].[Value]))....[/code]My first member returns the correct total (ATL), but my second one (PYATL) returns "#Error" because I am using a tuple set expression.The problem is that I can't figure out how to structure the syntax of PYATL so that it'll return the Previous Year's value.Thanks for your time.RegardsPaulo

Viewing all articles
Browse latest Browse all 1341

Trending Articles