2

我有一个 UserHierarchy,当当前级别的成员标题在名称中包含“#”时,类似于特定的用户类型。UserHierarchy 最多包含 5 个级别。

我想显示向下钻取的数据,但仅适用于这些特定的用户类型,因此只有那些带有“#”的标题。我还想汇总孩子们的数据。

MDX 中是否有一种简单的方法来完成此操作?

例子 :

#User1 2 欧元
---#User2 €6
---------用户4 €9
---------用户5 €4
---#User3 €2
---------用户6 €4
---------用户7 €4

我想像这样为自己和孩子展示数字。为了理解,我包括了这些数字的来源:

#User1 2 欧元
---#User2 19 欧元(获得自:6 欧元 + 9 欧元 + 4 欧元)
---#User3 10 欧元(获得自:2 欧元 + 4 欧元 + 4 欧元)
4

1 回答 1

2
select [Measures].[Internet Sales Amount] on columns,
non empty(
 distinct(
  descendants({[Product].[Category].children}) *
    {filter([Product].[Subcategory].members,
      instr([Product].[Subcategory].currentmember.member_caption, 'T') = 1)
    } 
  * descendants({[Product].[Product].children})
 )
)
on rows  from cube

结果与详细信息:

结果

“第二个结果:

在这里,我删除了该行:

* descendants({[Product].[Product].children})

我认为这就是您想要的,因为它显示了孩子的总数。

结果2

您需要将“T”换成“#”,然后还需要将维度名称和要显示为度量的内容。

于 2013-04-11T11:50:51.690 回答