Calculating parallel periods for multiple dates in a slicer
In the recipe Calculating the YoY (Year-over-Year) growth (parallel periods), we've shown how the ParallelPeriod()
function works when there's a single member involved. In Calculating parallel periods for multiple dates in a set, we've shown how to do the same, but on a range of members defined in a set. This recipe presents the solution to a special case, when the set of members is found in slicer.
Getting ready
We'll use the same case as in the previous recipe; we'll calculate the growth in the pre-Christmas season for each color of our products.
Start SQL Server Management Studio and connect to your SSAS 2012 instance. Click on the New Query button and check that the target database is Adventure Works DW 2012. Then execute this query:
SELECT { [Internet Sales Amount] } ON 0, { [Product].[Color].MEMBERS } ON 1 FROM [Adventure Works] WHERE ( { [Date].[Calendar].[Date].&[20071201] : [Date].[Calendar].[Date].&...