Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
agarciaguillen
Contributor II
Contributor II

Is it possible to order the result of AGGR ()?

Hi everyone, i have some problems with a metric that use AGGR() fuction.

With this metric i whant to know " how many customers represent the 80% of my sales" (Classic pareto analysis)

COUNT(AGGR(if(rangesum(top(($(M_SALES_YTD)),1,rowno()))/rangesum(top(($(M_SALES_YTD)),1,noofrows())) <=0.8,[Customer ID],Null()),[Customer ID]))

But if i put the value in a KPI, i saw the value is very large respect to value when i calculated in excel manually

When i put this metric in a table with customers id and sales amount, i can see the AGRR() function orderned the values alphabeticaly by Customer ID ( but i want sort the values by Sales Amount descending , to use this variable correctly)

Exist some way to give order the result of AGGR() function by a metric $(M_SALES_YTD) ?

Thanks in advance

2 Replies
Anonymous
Not applicable

agarciaguillen
Contributor II
Contributor II
Author

hI bill, thanks for the fast reply.

I saw this link, but when i try to use the formulas exposed in this post the result in KPI is 0 or error directly.

i tried with :


  • [Customer ID],(NUMERIC,DESCENDING)


  • [Customer ID],($(M_SALES_YTD) ,(NUMERIC,DESCENDING))


  • $(M_SALES_YTD) ,(NUMERIC,DESCENDING)


But in all of this the result is wrong.


Im really confused with this feature.