MDX - 如何排除 mdx 中的某些成员

发布于 2024-11-04 02:18:49 字数 357 浏览 2 评论 0原文

我想知道如何从一个维度中排除与另一个维度中的其他成员有链接的某些成员...假设我想排除具有状态 A 或状态 B (dim_status) 的客户端 (dim_clients)。 我知道如何交叉连接两个维度来获取这些客户端,但我不知道如何将它们从我的计算中排除,因为 EXCEPT 函数接受来自相同维度的两个集合,但我想要排除的那些是交叉连接操作的结果,我不能使用 except 函数,

我想要这样的东西:

SELECT Measure.MyMeasure ON 0 
FROM MyCUBE 
WHERE 
EXCEPT([DIM CLIENTS].[Clients], [EXCLUDED CLIENTS])

谢谢

i'm wondering how to exclude certain members from one dimension that have links with other members from another dimension ... let's say i want to exclude clients (dim_clients) that have a status A OR a status B (dim_status).
I know how to crossjoin the two dimensions to obtain those clients but i can't figure out how to exclude them from my calculation since the EXCEPT function accepts two sets from same dimensionality but the ones i want to exclude are the result of a crossjoin operation, i can't use the except function

i want something like this :

SELECT Measure.MyMeasure ON 0 
FROM MyCUBE 
WHERE 
EXCEPT([DIM CLIENTS].[Clients], [EXCLUDED CLIENTS])

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

婴鹅 2024-11-11 02:18:49
SELECT Measure.MyMeasure ON 0
FROM MyCUBE
WHERE
EXCEPT([DIM CLIENTS].[Clients], Filter({[DIM CLIENTS].[Clients]},[DIM_STATUS].CurrentMember IS [DIM_STATUS].statusA OR [DIM_STATUS].CurrentMember IS [DIM_STATUS].statusA))

我不太确定 [Clients] 是什么。不过我会使用会员。

SELECT Measure.MyMeasure ON 0
FROM MyCUBE
WHERE
EXCEPT([DIM CLIENTS].[Clients], Filter({[DIM CLIENTS].[Clients]},[DIM_STATUS].CurrentMember IS [DIM_STATUS].statusA OR [DIM_STATUS].CurrentMember IS [DIM_STATUS].statusA))

I am not too sure what [Clients] is. I would use Members though.

孤蝉 2024-11-11 02:18:49

您可以使用 Extract() 函数获取排除的客户端集具有正确的维度:

where - Extract( { [EXCLUDED CLIENTS] }, [DIM CLIENTS].[Clients] )

注意一元运算符来执行 except 操作。

You can use the Extract() function to get the set of excluded clients with the right dimensionality:

where - Extract( { [EXCLUDED CLIENTS] }, [DIM CLIENTS].[Clients] )

Note the unary operator to perform the except operation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文