gpt4 book ai didi

ssas - MDX 不等于基本问题

转载 作者:行者123 更新时间:2023-12-01 06:41:59 26 4
gpt4 key购买 nike

我是 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

谢谢

最佳答案

您可以使用 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]
)

关于ssas - MDX 不等于基本问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6989174/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com