简体   繁体   中英

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. The UserHierarchy, contains up to 5 levels.

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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