Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rank Issue

Hi Team,

I have attached an image with Rank function implemented for EmpID and their respective Salary.

Test.JPG

There are 4 Employes which have the same salary and Ranked as 4-5 and 8-9.

Now if I Group the Ranks into A & B, so that I can give different Ranks (i.e. the same salary gets divided into two groups) to the same salaries of different employees.

Kindly assist me implementing the same, using Rank function (without sorting)

EmpID, Salary, Rank, Group

Annie    8500    1,    A

Proj    7000    2,    A

Pith    6500    3,    A

Rossel    5000    4-5,  A

Zen    5000    4-5,  A

Richie    4500    6,    A

Paul    3000    7,    A

Rahim    2000    8-9,  A

Reshma    2000    8-9,  B

Rose    1000    10,   B

Thanks in advance

10 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try playing with second and third parameters of Rank() like below

Rank(Expression, 4, 0)  -- Lowest rank on first row, then incremented by one for each row.

Rank(Expression, 3, 0)  -- Highest rows for all matching rows


Refer Qlikview help file for more details.


Regards,

Jagan.



Not applicable
Author

Hi Jagan,

Thanks for your inputs.

I tried performing but seems I'm going wrong at some point.

My current Sales and Rank expressions are as below :

Sales - sum(Sal)

Rank - rank(sum(Sal))

Can you assist me with the expression forthe same.

Thanks

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

Rank - rank(sum(Sal), 4, 0)

OR

Sales - sum(Sal)

Rank - rank(sum(Sal), 3)

Regards,

Jagan.

qlikviewwizard
Master II
Master II

Hi Robin123,

Please select the options as shown in below screen on Rank Expression.

Hope it will help you.

Thanks.

Capture.JPG

Kushal_Chawda

try,

rank(sum(Sal), 4, 0)

Not applicable
Author

Hey Robin do this and put number  as format as in above screen shot by wizard

=rank(aggr(sum(Salary),EmpID),4,1)

It is working well fr me.

Not applicable
Author

Hi Robin,

Please find the attached QVW file.It can be implemented in pivot chart using rank function.

qlikviewwizard
Master II
Master II

Hi Robin123,

Did you resolve your issue?

Not applicable
Author

Hello All,

Thanks everyone for your valuable inputs. I tried out sometime back and works fine for me.

Apologies for the delay in response, due to sick leave.