Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

agarciaguillen
New 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

Tags (3)
2 Replies

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

agarciaguillen
New Contributor II

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

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.


Community Browser