2

这行得通

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]
)
4

2 回答 2

0
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

跳这个帮助!

于 2014-10-30T14:36:02.193 回答
0

试试这个,可能有用..

SUM
(
-{
[Dim Event].[Ticket].&[Open]
},
{
[Dim Category].[Status].&[OPEN]
},
(
[Measures].[Event Incidents Count]
)
)
于 2013-12-05T04:48:40.377 回答