【问题标题】:icCube - function calling another function results in NULLicCube - 调用另一个函数的函数导致 NULL
【发布时间】: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,并且没有办法深入到根本原因.... 自己尝试一下。您可以复制并粘贴代码并将其应用于销售模式。你会明白我的意思。

标签: mdx iccube


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-20
    • 2014-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多