MDX:如何排除在此查询中返回的祖先?

发布于 2024-08-25 08:41:40 字数 295 浏览 5 评论 0原文

我有这个 MDX 查询:

Exists([Group].[Group Hierarchy].allmembers,
    {[Group].[Group Full Name].&[121 - Group A], [Group].[Group Full Name].&[700000 - Group C]})

...它工作正常,除了它还返回指定组的所有祖先。我想要的是仅返回具有指定组名称的层次结构中的组(这是类型 2 维度,因此可能有许多不同级别的维度)。

有什么想法吗?

I have this MDX query:

Exists([Group].[Group Hierarchy].allmembers,
    {[Group].[Group Full Name].&[121 - Group A], [Group].[Group Full Name].&[700000 - Group C]})

... which works fine EXCEPT that it returns all of the ancestors of the specified groups as well. What I want is to return JUST the groups from the hierarchy with the specified Group Names (this is a type 2 dimension so there may be many at different levels).

Any ideas?

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

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

发布评论

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

评论(3

○愚か者の日 2024-09-01 08:41:47

我怀疑问题出在对 [Group].[Group Hierarchy].allmembers 的引用上。我猜测 [Group Hierarchy] 是某种具有多个级别的导航层次结构。听起来您需要做的是将 [Group Hierarchy] 替换为包含类型 2 组成员的属性名称,以便获取与指定的“组全名”成员一起存在的所有成员的列表。

我会将 Filter(..., Instr()) 方法作为最后的手段,因为它比等效的基于集合的操作慢得多。

I suspect that the issue is with the reference to [Group].[Group Hierarchy].allmembers. I'm guessing that [Group Hierarchy] is some sort of navigational hierarchy with multiple levels. It sounds like what you need to do is to replace [Group Hierarchy] with the name of the attribute that contains your type 2 group members in order to get a list of all the members that exist with the specified "Group Full Name" members.

I would leave Filter(..., Instr()) approach as a last resort as it would be much slower than the equivalent set based operation.

述情 2024-09-01 08:41:46

filter([组].[组层次结构].members, instr(@GroupGroupFullName,[组].[组层次结构].Properties( "组全名" )))

filter([Group].[Group Hierarchy].members, instr(@GroupGroupFullName,[Group].[Group Hierarchy].Properties( "Group Full Name" )))

昇り龍 2024-09-01 08:41:45

替换

[Group].[Group Hierarchy].allmembers 

[Group].[Group Hierarchy].[Group Hierarchy]

Replace

[Group].[Group Hierarchy].allmembers 

with

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