Ssas 在MDX中交叉连接多个度量值组

Ssas 在MDX中交叉连接多个度量值组,ssas,mdx,cross-join,Ssas,Mdx,Cross Join,我有两个维度,一个度量值组:[Time].[Day],[Scenario].[Scenario]和包含两个度量值的度量值组:[measures].[CleanPrice]和[measures].[DirtyPrice] 我从以下结果开始,结果很好: 01-01-2011 01-01-2012 Base CleanPrice 100 100 Base DirtyPrice 100 100 Up1% C

我有两个维度,一个度量值组:[Time].[Day],[Scenario].[Scenario]和包含两个度量值的度量值组:[measures].[CleanPrice]和[measures].[DirtyPrice]

我从以下结果开始,结果很好:

                   01-01-2011  01-01-2012
Base  CleanPrice      100         100
Base  DirtyPrice      100         100
Up1%  CleanPrice      101         101
Up1%  DirtyPrice      101         101
我真正想要产生的是一个计算成员来显示度量,以及当前场景和基本场景之间的增量

所需结果应如下所示:

                         01-01-2011  01-01-2012
Base  CleanPrice  Value    100         100
Base  CleanPrice  Delta    0           0
Base  DirtyPrice  Value    100         100
Base  DirtyPrice  Delta    0           0
Up1%  CleanPrice  Value    101         101
Up1%  CleanPrice  Delta    1           1
Up1%  DirtyPrice  Value    101         101
Up1%  DirtyPrice  Delta    1           1
我尝试了类似的操作,但无法交叉连接度量值组:

WITH MEMBER [Value] as [Measures].CurrentMember
MEMBER [Delta] as [Measures].CurrentMember - ([Scenario].[Scenario].&[0], [Measures].CurrentMember)
SELECT NON EMPTY 
{ [Time].[Day].&[2011-01-01T00:00:00], [Time].[Day].&[2012-01-01T00:00:00] }
ON COLUMNS,
{ [Scenario].[Scenario].&[0], [Scenario].[Scenario].&[1] }  * 
{ [Measures].[CleanPrice], [Measures].[DirtyPrice] } *
{ [Value], [Delta] }
ON ROWS
FROM Results
我创建了两个计算成员,[Value]作为当前度量值,[Delta]作为当前度量值,并根据基本场景得到该度量值的差值

我想交叉加入包含净价格和脏价格的度量值组,度量值组由两个计算成员组成,但这是不可能的


有没有办法达到预期的效果?我希望避免创建度量值[CleanPrice Delta]和[DirtyPrice Delta],因为我实际上有很多度量值。

一种方法是创建一个新维度,比如说,
[Metric]
有两个成员,
[Value]
[Delta]
。然后按照以下行将MDX写入计算脚本:

SCOPE ([Metric].[Delta], [Scenario].[Scenario].[Scenario]);
    this =   ([Metric].[Value], [Scenario].[Scenario].currentmember)
           - ([Metric].[Value], [Scenario].[Scenario].&[0]);
END SCOPE;

然后,这将自动适用于链接到
[Scenario]
维度的所有度量值。

一种方法是创建一个新维度,例如,
[Metric]
,包含两个成员,
[Value]
[Delta]
。然后按照以下行将MDX写入计算脚本:

SCOPE ([Metric].[Delta], [Scenario].[Scenario].[Scenario]);
    this =   ([Metric].[Value], [Scenario].[Scenario].currentmember)
           - ([Metric].[Value], [Scenario].[Scenario].&[0]);
END SCOPE;
然后,这将自动适用于链接到
[场景]
维度的所有度量