I've not done any serious MDX for about 18 months and this is starting to bug me. I want to create a YTD set, based on a Period setting.The Period dimension is All->Year->Qtr->Month, and has a member property on the Month that denotes the current period. In SSMS if I Run the Query[code="sql"]Select FILTER ( [Period].[Yr - Qtr - Mth].[Period].Members ,[Period].[Period].Properties("Is Current Period") ) ON ROWS, NULL ON COLUMNSFROM [CUBE][/code]I get the correct result of 201405. However when place the FILTER in to the following into a CREATE MEMBER [code="sql"]CREATE MEMBER CURRENTCUBE.[Measures].[YTD Measure] AGGREGATE ( YTD ( FILTER ( [Period].[Yr - Qtr - Mth].[Period].Members ,[Period].[Period].Properties("Is Current Period") ) ) ,[Measures].[aMeasure] )[/code]I get a #Value, however If I switch the Filter in the YTD to [code="sql"]STRTOMEMBER("[Period].[Yr - Qtr - Mth].[Period].["+FORMAT(NOW(),"yyyy")+FORMAT(NOW(),"MM")+"]")[/code]It works. The issue with this method is that the Current period doesn't 'switch' on the first of the month, and can be 2-3 days later once the source data has been signed off.
↧