【发布时间】:2017-10-04 02:14:45
【问题描述】:
在 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 中这是不可能的。但有可能吗?如果是,如何?
【问题讨论】:
-
ps。您可以在模式 Sales 上的 icCube 默认环境中触发该语句。
-
你试过MDX调试器了吗?
-
是的,在单元格的循环中它显示为 NULL,并且没有办法深入到根本原因.... 自己尝试一下。您可以复制并粘贴代码并将其应用于销售模式。你会明白我的意思。