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

Using a Named Set for a Date Range

$
0
0
I created a Named Set for what I wanted to be a rolling 12 Month range using the code below.When I attempt to use the set in a Calculated Member I do not get the results I expect. For example the two Calculated Members below give different results:with set [Last Twelve Months] as {ParallelPeriod( [Calendar].[Calendar Month].[Calendar Month], 11, [Calendar].[Calendar Month].currentmember ): [Calendar].[Calendar Month].currentmember }member [Measures].[Sales LTM] assum( [Last Twelve Months] ,[Measures].[Store Sales])member [Measures].[Sales LTM 2] assum( {ParallelPeriod( [Calendar].[Calendar Month].[Calendar Month], 11, [Calendar].[Calendar Month].currentmember ) : [Calendar].[Calendar Month].currentmember } ,[Measures].[Store Sales])select { [Measures].[Sales LTM] ,[Measures].[Sales LTM 2] } on columns, { [Calendar].[Calendar Month].&[201509] } on rowsfrom [Customer Datamart]I am having difficulty understanding why the Calculation with the Named Set does not appear to get the context for CurrentMember, instead it returns the sum of all Sales ignoring the Date range. the second Calculation does what I expected, returning the Sales for the rolling 12 month period. Can anyone explain what is going on with this?

Viewing all articles
Browse latest Browse all 1341

Latest Images

Trending Articles



Latest Images