MDX获取层次结构每个级别的维数

时间:2019-06-18 01:46:12

标签: ssas mdx

我有一个深入到层次结构的MDX查询-我需要每个级别的维数。我尝试了一个count函数,但它似乎不适用于每个级别:

 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]

这给我每个级别相同的计数:

MDX Results

我在做什么错?如何获得每个级别的计数?

1 个答案:

答案 0 :(得分:0)

看看下面的例子

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]

结果

enter image description here