Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

qlik_dpadhan
New Contributor

Nested Rank Function

Hi All,

We are using Qlik Sense April 2018 version.

We  have a business requirement on rank function.In my qvd i have Emp Name,Sales Value and Revenue value.I want calculate the Rank of Employee first based on Sales Value and then on Revenue .If the Sales value of two employees are same then it should check for revenue value and then calculate the final rank for the employee.

Please find the below example.

     

CCSalesRevenueRank(sum(Sales))Rank(sum(Revenue))Final Rank(If sales rank is same then check for revenue rank)
AA50003000111
BB40001500233
CC40002000222
DD30001000344

Please help me to resolve this issue.

Thanks,

Duryodhan

Tags (1)
4 Replies

Re: Nested Rank Function

May be this

Rank(RangeSum(Sum(Sales), Sum(Revenue)/1E10))

Re: Nested Rank Function

Sample image and file attached

Capture.PNG

rangam_s
Contributor II

Re: Nested Rank Function

Check this app.

if(SubStringCount(Rank(Sum(Sales)),'-')>=1,Rank(Sum(Revenue)),Rank(Sum(Sales)))

rangam_s
Contributor II

Re: Nested Rank Function

or this,

if(SubStringCount(','&Concat(Total (Aggr(Rank(Sum(Sales)),CC)),',')&',',','&Rank(Sum(Sales))&',')>1,Rank(Sum(Revenue)),Rank(Sum(Sales)))

Community Browser