IcCube function - calling another function results in NULL
Below are MDX instructions on icCube. (Note that icCube has a non-native language component called a function).
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
I cannot get the calculated measure of [bm_top_amount_doesnotwork] and [bm_top_amount_doesnotwork_either] to work.
My idea is to have 2 common functions and the second is the first. The end result is a benchmark that can be used for charts, calculations, etc.
I can see this is not possible from the above MDX. But is it possible? And if YES, how?
+3
source to share