Discussion board where members can get started with Qlik Sense.
With the below table. I want to calculate top 2 companies base on the sum of sales. Can some please help me with the logic.
Go to Solution.
Company : =If(Aggr(VRank(TOTAL Sum(Amount),0,1)<=2,Company,Year),Company)
Try this as dimension
=aggr ( if ( rank(Sum( Amount)) <=2,Company) , Company )
And this as expression
On the Dimension untick Include Null Values
Thanks for looking into this. But this expression is not giving me the right result. Maybe I did not share right information.
With the expression, you shared I got the result below.
But the Output I want to see the TOP 2 sales amount is.
This I have achieved by using Spotfire. But I am facing some challenges while migrating the same to QLIK.
This is for TOP 5:
rank(total aggr(sum(Amount), Year, Company)) <= 2,
One solution i can think now would be to concatenate year and company field in the load script and use the below condition for all the dimensions and expression
Please find the sample document as attachment.
Thanks it worked as expected.
Thanks for your help!!
Thank you for looking into this.