Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
chetand_anand
Contributor
Contributor

Rank Function in Qlikview

Using Rank function in New Expression labelled as Rank and giving definition as =Aggr(Rank(Sum(Value),1,1),Numbers) and getting this result.

chetand_anand_0-1611333092691.png

But the requirement is this one:

chetand_anand_1-1611333188976.png

Please let me know if i am doing any mistake in defining expression.

1 Reply
edwin
Specialist III
Specialist III

if the resulting number is the same, rank will always give you the same rank.  what you can do is add a bias in the rank.  if your rule is for the same rank sort by alphabetical order and the first has a higher/lower rank - assign a very small fraction to your individual IDs making sure the largest will never influence your result.  
for example, you have 1000 IDs and your Value is always integer.  assign your bias as 1/10000 for the first and 1000/10000 for the last (you can do this programmatically using rownum

this way you rank using expression + bias  so the 54 value would result in 54.0001 and 54.0002 so QV will be able to rank it per customer