Looks like the multi-select problem discussed in this blog entry:
http://sqlblog.com/blogs/mosha/archive/2005/11/18/writing-multiselect-fr
iendly-mdx-calculations.aspx
>>
Writing multiselect friendly MDX calculations
One very common problem with authoring MDX calculations historically has
been the behavior of these calculations when the user who browses the
cube selects multiple members in the slicer as opposed to single one.
...
>>
So, for your specific query which has multi-select for months, you might
try something like:
WITH MEMBER [Measures].[Margin] AS ([Measures].[Sale Amt - Shipped
Fact]-[Measures].[Cost Amt - Shipped Fact]), FORMAT_STRING = "Currency"
MEMBER [Measures].[LYMargin] As
Sum(existing [Shipped Time].[Month].[Month].Members,
(
PARALLELPERIOD(
[Shipped Time].[Year - Quarter - Month - Date - Date Time - Is
Holiday - Is Weekday].[Year]
, 1
, [Shipped Time].[Year - Quarter - Month - Date - Date Time - Is
Holiday - Is Weekday].CurrentMember)
,[Measures].[Margin])), FORMAT_STRING = "Currency"
MEMBER [Measures].[Cost] AS ([Measures].[Cost Amt - Shipped Fact]) ,
FORMAT_STRING = "Currency"
MEMBER [Measures].[LYCost] AS
Sum(existing [Shipped Time].[Month].[Month].Members,
(
PARALLELPERIOD(
[Shipped Time].[Year - Quarter - Month - Date - Date Time - Is
Holiday - Is Weekday].[Year]
, 1
, [Shipped Time].[Year - Quarter - Month - Date - Date Time - Is
Holiday - Is Weekday].CurrentMember)
,[Measures].[Cost])), FORMAT_STRING = "Currency"
...
- Deepak
Deepak Puri
Microsoft MVP - SQL Server
*** Sent via Developersdex
http://www.developersdex.com ***