MDX AllMembers不显示计算成员

时间:2012-09-17 04:01:55

标签: mdx

假设我有三个成员的层次结构[Rank].[Rank]

[Rank].[Rank].&[Boss]
[Rank].[Rank].&[Manager]
[Rank].[Rank].&[Supervisor]
[Rank].[Rank].&[Serf]

然后在查询中创建一个计算成员

MEMBER [Rank].[Rank].[Middle Managers] AS 
      [Rank].[Rank].&[Manager] + [Rank].[Rank].&[Supervisor]

如果我说

with 

member [Rank].[Rank].[Middle Managers] AS 
           [Rank].[Rank].&[Manager] + [Rank].[Rank].&[Supervisor]

select
   {
     [Measures].[Hours] 
   }
   on 0

   , [Rank].[Rank].[Rank].ALLMEMBERS
   on 1
from 
  some_cube

我没有得到[Rank]。[Rank]。[Middle Managers]出现在结果集中,但如果我使用

with 

member [Rank].[Rank].[Middle Managers] AS 
           [Rank].[Rank].&[Manager] + [Rank].[Rank].&[Supervisor]

select
   {
     [Measures].[Hours On Stack Overflow] 
   }
   on 0

   , [Rank].[Rank].[Rank].ALLMEMBERS + [Rank].[Rank].[Middle Managers]
   on 1
from 
  some_cube

我明白了。

但我认为ALLMEMBERS包含计算成员。谁能看到我做错了什么?

1 个答案:

答案 0 :(得分:1)

你的命名有点混乱([Rank]。[Rank]。[Rank] vs [Rank]。[Rank]用法);你可以试试(注意名字中的额外[等级]):

with member [Rank].[Rank].[Rank].[Middle Managers] AS 
           [Rank].[Rank].&[Manager] + [Rank].[Rank].&[Supervisor]

[edit]附加你的计算结果。成员成为[Rank]工作级别以上的成员:

with member [Rank].[Rank].&[Boss].parent.[Middle Managers] AS 
           [Rank].[Rank].&[Manager] + [Rank].[Rank].&[Supervisor]