gpt4 book ai didi

mdx - icCube - 调用另一个函数的函数结果为 NULL

转载 作者:行者123 更新时间:2023-12-04 19:27:31 24 4
gpt4 key购买 nike

在 icCube 上的 MDX 声明下方。 (请注意,icCube 有一个非母语组件,称为函数)。

with function article_list() as topcount([Product].[Product].[Article], [amount], 10)
function benchmark_best_index2(i) as sum(order(topcount([Product].[Product].[Article], [amount], 10), [measures].[amount], desc).(i-1) , [measures].[amount])


// why doesnot the following function work?
function benchmark_best_index(list,i) as sum(order(list, [measures].[amount], desc).(i-1), [measures].[amount])


member [measures].[bm_top_amount_doesnotwork] as benchmark_best_index(article_list(),1)
member [measures].[bm_top_amount_doesnotwork_either] as benchmark_best_index( topcount([Product].[Product].[Article], [amount], 10),1)
member [measures].[bm_top_amount_works] as benchmark_best_index2(1)

select { [measures].[amount],[measures].[bm_top_amount_doesnotwork], [measures].[bm_top_amount_doesnotwork_either], [measures].[bm_top_amount_works]} on 0
,article_list() on 1
from sales

我无法使计算的度量 [bm_top_amount_doesnotwork] 和 [bm_top_amount_doesnotwork_either] 起作用。

我的想法是有 2 个通用函数,第二个调用第一个。最终结果是一个基准值,可用于图表、计算等。

我发现从上述 MDX 来看这是不可能的。但有可能吗?如果是,怎么办?

最佳答案

我们必须详细检查哪里出了问题 (issue),同时您可以强制参数的类型,以便 MDX 解析器知道它是一个集合:

sum(order( {list} , [measures].[amount], desc).(i-1), [measures].[amount])

关于mdx - icCube - 调用另一个函数的函数结果为 NULL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43807623/

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