如何避免icCube中的错误"Category member XXX defined as an empty set"?

how to avoid the error "Category member XXX defined as an empty set" in icCube?

我有以下 MDX 代码来创建具有 4 个成员的类别维度:

该代码在有很多成员的关卡上运行完美:

WITH
MEMBER [measures].[v] as eval([Tijd].[Tijd].[jaar].[2018],[Measures].[Bedrag])

set [selection] as Order( nonempty([Categorie].[Categorie].[categorie].members,[measures].[v]), [measures].[v], BDESC)  

CATEGORY HIERARCHY [Stats].[ABCD], DEFAULT_MEMBER_NAME = "Totaal", LEVEL_NAME_PATTERN="L - ABCD - ${levelDepth}"
CATEGORY MEMBER [Stats].[ABCD].[Totaal].[A (0-50%)] as
     TopPercent([selection],50, [measures].[v] ), ADD_CHILDREN=true
CATEGORY MEMBER [Stats].[ABCD].[Totaal].[B (50-80%)] as
    TopPercent([selection],80, [measures].[v] )
    - TopPercent([selection],50, [measures].[v]), ADD_CHILDREN=true
CATEGORY MEMBER [Stats].[ABCD].[Totaal].[C (80-95%)] as
    TopPercent([selection],95, [measures].[v])
    - TopPercent([selection],80, [measures].[v] ), ADD_CHILDREN=true
CATEGORY MEMBER [Stats].[ABCD].[Totaal].[D (95-100%)] as
    Order([selection], [measures].[v], BDESC)
    - TopPercent([selection],95, [measures].[v]), ADD_CHILDREN=true

SELECT
// Measures
{[measures].[v]} On 0,
// Columns    
[Stats].[ABCD].[L - ABCD - 1].members on 1,
// Rows   
[Stats].[ABCD].[L - ABCD - 2].members on 2
FROM (select  [Tijd].[jaar].[2018] on 0 from [Spendzoom])
/*ic3navigation*/

但是当我 运行 MDX 代码时:

set [selection] as Order( nonempty([Categorie].[Categorie].[type].members,[measures].[v]), [measures].[v], BDESC)  

我收到错误:类别成员“[Stats].[ABCD].[Totaal].[C (80-95%)]”定义为空集。

我尝试重写定义,如:

subcubeminus(TopPercent .... , TopPercent)

但这给出了完全奇怪的结果。

我怎样才能克服这个错误并拥有一个无论 [selection] 定义中层次结构和级别的内容如何都始终有效的通用方法?

要了解发生了什么,您应该检查 TopPercent 是如何工作的(这并不是您所期望的)。

试试这个 MDX :

WITH
  MEMBER [measures].[v] as eval([Tijd].[Tijd].[jaar].[2018],[Measures].[Bedrag])
  STATIC SET [selection] as [Categorie].[Categorie].[categorie].members
SELECT
  [measures].[v] On 0,
  TopPercent([selection],95, [measures].[v]) on 1,
  TopPercent([selection],80, [measures].[v] ) on 2
FROM 
  (select  [Tijd].[jaar].[2018] on 0 from [Spendzoom])

如您所见,return 是同一组,我猜这不是您要找的。

正如评论中提到的ic3,从icCube 6.8.10开始,icCube现在允许有空类别。 Y

对我来说,这意味着,从商业角度来看,无论全局过滤器设置如何,类别始终有效。如果它是一个空集,它会在仪表板中产生一个空白值。

example of a Parato analysis for just 1 vendor (bedrag = amount, #Fact = nr of invoices, #Lev = nr of suppliers)

完全符合要求。