3 Replies Latest reply: May 24, 2017 11:33 AM by Sunny Talwar RSS

    Set Analysis: Top 10 records fitting a particular criteria

    Anike Ditchfield



      I'm currently trying to write a QlikSense if statement to fill the following criteria - the top 10 suppliers who supply over 10% of our current stock, and with a returns rate of above 35%.

      My current syntax is as follows, however this does not work: 

      =aggr(if(if((Sum(Product.StockToday)/sum(Total Product.StockToday)) >.01 and (Sum(Sales.ReturnsLineTotalGBP)/sum(Sales.GrossSellingPriceGBP)) <.35 ,
      Rank(aggr((Sum(Sales.ReturnsLineTotalGBP)/sum(Sales.GrossSellingPriceGBP))), Product.Current_Supplier,4))<11, Product.Current_Supplier),Product.Current_Supplier)


      Any tips of solutions would be greatly appreciated - thanks!