gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 08:51:13 26 4
gpt4 key购买 nike

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

  • 占测量值 0-50% 的所有成员 (TopPercent)
  • 成员 50-80%
  • 成员(member) 80-95%
  • 成员 95-100%

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

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])

如您所见,两者都返回相同的集合,我猜这不是您想要的。

关于mdx - 如何避免icCube中的错误 "Category member XXX defined as an empty set"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56795353/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com