在 MDX+ 类别层次结构的子项上导航似乎不起作用

Navigation on a child of a MDX+ Category hierarchy does not seem to work

问题

当我在类别成员的子项上定义导航时,当我单击成员时出现以下 MDX 错误:

[Stats].[Top X].[Total].[subtotal].[<child of subtotal category]' is not a known MDX entity

这是set-up

我已简化 MDX 并将其传输到默认销售多维数据集上的 运行:

set [level] as [Customers].[Geography].[City]
set [selection] as
filter([level],mid([level].currentmember.name,1,1) = 'A')
+     filter([level],mid([level].currentmember.name,1,1) = 'B')
+     filter([level],mid([level].currentmember.name,1,1) = 'C')

/* MDX + function to create a dynamic hierarchy */    
CATEGORY HIERARCHY [Stats].[ABC], DEFAULT_MEMBER_NAME = "Total",LEVEL_NAME_PATTERN="L - TOP X - ${levelDepth}"
CATEGORY MEMBER [Stats].[ABC].[Total].[subtotal] as [selection] , ADD_CHILDREN=true
CATEGORY MEMBER [Stats].[ABC].[Total].[remainder] as except([level],[selection]),ADD_CHILDREN=false  
 
        
SELECT
{[Measures].[amount]} on 0,
{[Stats].[ABC].[total].[subtotal].children
,[Stats].[ABC].[total].[subtotal]
,[Stats].[ABC].[total].[remainder]
,[Stats].[ABC].[total]}  on 1
FROM [sales]

在 table 小部件中,我将导航定义为:

when $member.name = 'subtotal'  then ic3drilldownStop()
when $member.name = 'total'  then ic3drilldownStop()
when $member.level is [Time].[Calendar].[Month] then ic3drilldownStop()
else nonempty([Time].[Calendar].[Month],[measures].[amount])
end

结果是

现在点击,例如,波哥大给出:

错误: [Stats].[Top X].[Total].[subtotal].[Bogotá]' is not a known MDX entity

问题 如何解决这个错误?

问题是因为您试图使用在 SELECT 语句本身中定义的类别成员。作为一种变通方法,您可以修改您的向下钻取 MDX 表达式,如下所示:

non empty

case
when $member.name = 'subtotal'  then ic3drilldownStop()
when $member.name = 'total'  then ic3drilldownStop()
when $member.level is [Time].[Calendar].[Month] then ic3drilldownStop()
else nonempty([Time].[Calendar].[Month],[measures].[amount])
end
   
axis 0  ([Measures].[Amount], $member) 

如您所见,该表达式不仅重新定义了轴 1,还重新定义了轴 0,以模仿“过滤依据”选项(即,在您的示例中按 Bogota 成员过滤)。