2017-05-05 99 views
3

icCube上的MDX語句下方。 (請注意,icCube具有非本地語言組件,稱爲函數)。icCube - 調用另一個函數的函數結果爲NULL

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。但是有可能嗎?如果是,如何?

+0

PS。您可以觸發架構Sales的icCube默認環境中的語句。 – Arthur

+1

您是否嘗試過MDX調試器? – ic3

+0

是的,在單元格中的循環中,它顯示爲空,並且沒有辦法深入根源....有一個嘗試自己。您可以複製並粘貼代碼並將其應用於銷售模式。你會明白我的意思。 – Arthur

回答

2

我們在具體出了什麼問題(issue)在此期間,您可以強制參數的類型,從而使MDX解析器知道它是一組檢查:

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