这行得通
WITH MEMBER [Measures].[Pre] AS
SUM
(
-{
[Dim Event].[Ticket].&[Open]
},
(
[Measures].[Event Incidents Count]
)
)
Select [Measures].[Pre] on 0
From Event
但是,像这样添加另一个维度
WITH MEMBER [Measures].[Pre] AS
SUM
(
-{
[Dim Event].[Ticket].&[Open]
,[Dim Category].[Status].&[OPEN]
},
(
[Measures].[Event Incidents Count]
)
)
Select [Measures].[Pre] on 0
From Event
导致了这个错误,
执行查询...成员、元组或集合必须在函数中使用相同的层次结构。执行完成
如何将第二个查询重写为具有两个维度。顺便说一句,这是一个立方体计算,所以我只会使用这样的东西
SUM
(
-{
[Dim Event].[Ticket].&[Open]
,[Dim Category].[Status].&[OPEN]
},
(
[Measures].[Event Incidents Count]
)
)
更新:解决方案
WITH MEMBER [Measures].[Pre] AS
SUM
(
CROSSJOIN(
- {
[Dim Event].[Ticket].&[Open] }
, - { [Dim Category].[Status].&[OPEN] }
)
,
[Measures].[Event Incidents Count]
)