icCube - 调用另一个函数的函数导致NULL

时间:2017-05-05 14:33:00

标签: mdx iccube

在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个通用函数,第2个调用第一个函数。最终结果是可用于图表,计算等的基准值。

我认为这不可能形成上述MDX。但这可能吗?如果是,那该怎么办?

1 个答案:

答案 0 :(得分:2)

我们要详细检查出错的地方(issue),同时你可以强制参数的类型,以便MDX解析器知道它是一个集合:

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