我是SSAS和SSRS的BI入门者,我有一个非常基本的MDX问题。
获取与计算成员中的条件匹配的所有值非常容易。例如
WITH MEMBER [MEASURES].TOTAL_DOT_TEST
AS
(
[Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot Classification].&[3],
[Measures].[Fact Transportation Incident Count]
)
将获得分类值为3的运输事件数。
但是,使用此示例,如何获得ID不为3的运输事件数量?
喜欢的东西 选择 * 从表 其中分类<> 3
由于
答案 0 :(得分:3)
您可以使用Aggregate()和Except(),如下所示:
WITH MEMBER [MEASURES].TOTAL_DOT_TEST
AS Aggregate (
Except(
[Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot Classification].members ,
{ [Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot Classification].&[3] }
),
[Measures].[Fact Transportation Incident Count]
)