简体   繁体   中英

MDX Get dimension count for each level of hierarchy

I have an MDX query which drills into a hierarchy - I need the count of a dimension for each level. I have tried a count function but it doesnt seem to work against each level:

 member [RefIDCount] as distinctCount([Incident Details].[Process Safety Classification].&[Tier 1])

 select 
 {
    [RefIDCount]
} on columns, 
{
 DESCENDANTS(
    [Reporting Hierarchies].[Hierarchy].[Reporting Category].&[49]
 --  #RepCat#
)
} on rows
FROM [Monthly Stats]

This gives me the same count for each level :

MDX结果

What am I doing wrong? How do I get the count to be per level?

Take a look at the example below

with member measures.t
as 
[Product].[Product Categories].currentmember.level.members.count
select 
{[Measures].[Internet Sales Amount],measures.t}
on 0,
descendants([Product].[Product Categories].members
)
on 1 
from 
[Adventure Works]

Result

在此输入图像描述

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