简体   繁体   English

MDX-在层次结构中向下钻取到具有包含“#”的成员标题的最后一级

[英]MDX - Drill down in a hierarchy to the last level having the member caption containing “#”

I have a UserHierarchy, and when the member caption of the current level contains a "#" in the name, is resembles a particular user type. 我有一个UserHierarchy,当当前级别的成员标题的名称中包含“#”时,它类似于特定的用户类型。 The UserHierarchy, contains up to 5 levels. UserHierarchy,最多包含5个级别。

I would like to display drilled down data, but only for these particular user types, hence only those captions which have "#". 我想显示深入的数据,但仅针对这些特定用户类型,因此仅显示具有“#”的字幕。 I would also want to aggregate the children's data. 我还想汇总孩子的数据。

Is there a simple way in MDX to accomplish this? MDX中有一种简单的方法可以完成此操作吗?

Example : 范例:

#User1 €2
---#User2 €6
---------User4 €9
---------User5 €4
---#User3 €2
---------User6 €4
---------User7 €4

I would like to display figures, for themselves and children like this. 我想为自己和孩子们展示数字。 To understand, I included where the figures were obtained from : 为了理解,我列出了从哪里获得这些数据:

#User1 €2
---#User2 €19 (Obtained from : €6 + €9 + €4)
---#User3 €10 (Obtained from : €2 + €4 + €4)
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

Result with detailed info: 结果与详细信息:

结果

"Second result: “第二个结果:

Here i have deleted the row: 在这里,我删除了该行:

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

I think that´s what you want since it shows the totals of the children. 我认为这是您想要的,因为它显示了孩子们的总数。

RESULT2

You need to exchange the 'T' for your '#' then also the dimension names and what you want to show as a measure. 您需要将“ T”换成“#”,然后还要将尺寸名称和要显示为度量的内容进行交换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM