MDX:如何排除在此查询中返回的祖先?
我有这个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我怀疑问题出在对 [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.
filter([组].[组层次结构].members, instr(@GroupGroupFullName,[组].[组层次结构].Properties( "组全名" )))
filter([Group].[Group Hierarchy].members, instr(@GroupGroupFullName,[Group].[Group Hierarchy].Properties( "Group Full Name" )))
替换
为
Replace
with