2 Replies Latest reply: Feb 26, 2018 3:19 PM by Alvaro Garcia RSS

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

    Alvaro Garcia

      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