0

假设我有[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 包括计算成员。谁能看到我做错了什么?

4

1 回答 1

1

您的命名有点混乱([Rank].[Rank].[Rank] vs [Rank].[Rank] 用法);您可以尝试(注意名称中额外的 [Rank]):

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

[编辑] 附上你的计算。成员转换为 [Rank] 以上级别的成员工作:

with member [Rank].[Rank].&[Boss].parent.[Middle Managers] AS 
           [Rank].[Rank].&[Manager] + [Rank].[Rank].&[Supervisor]
于 2012-09-17T04:14:37.873 回答