the issue
When I define navigation on a child of a Category member I get the following MDX error when I click on a member:
[Stats].[Top X].[Total].[subtotal].[<child of subtotal category]' is not a known MDX entity
this is the set-up
I have simplified the MDX and transferred it to run on the default Sales cube:
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]
In the table widget, I have defined the navigation as:
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
Now clicking on, for example, Bogota gives:
Error:
[Stats].[Top X].[Total].[subtotal].[Bogotá]' is not a known MDX entity
the question How to solve this error?
The issue is because you're trying to use a category member defined in the SELECT statement itself. As a workaround you could modify your drilldown MDX expression as following:
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)
As you can see the expression is not only redefining the axis 1 but the axis 0 as well to mimic the "Filter by" option (i.e., filtering by the Bogota member in your example).