gpt4 book ai didi

mdx - 在脚本错误中创建集 - 'is neither a dimension or a hierarchy within the cube'

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

我正在尝试在 icCube 的模式管理器的脚本用例中创建一个 SET:

CREATE SET [TOP_10_SALES] AS
TopCount([BRAND].members - [BRAND].all, 10, [Measures].[Sales])

当我在报告中使用这个集合时,我收到以下错误消息:

'set([TOP_10_SALES]) : [Measures].[Sales] is neither a dimension or a hierarchy within the cube.'

如果我将相同的集合放在小部件的 WITH 子句中,它工作正常,但我真的很想在架构管理器中只定义该集合一次,而不是在每个小部件中。

最佳答案

脚本上下文不同于查询上下文。在查询上下文中,多维数据集名称是已知的,但脚本并非如此。我猜你的模式有不止一个多维数据集。

您必须像这样将多维数据集添加到定义中:

CREATE SET [MyCube].[TOP_10_SALES] AS    
TopCount([BRAND].members - [BRAND].all, 10, [Measures].[Sales])

从 6.8 版开始,如果您的架构中只有一个多维数据集,您可以直接编写

CREATE SET [TOP_10_SALES] AS ([BRAND].members - [BRAND].all, 10, [Measures].[Sales])

关于mdx - 在脚本错误中创建集 - 'is neither a dimension or a hierarchy within the cube',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38226885/

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