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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Calculate Rank from expression..

Dear friends,

I need to calculate the Rank from the expression (here i need to calculate from expression only, not from the source field and also it shouldn't be calculated in the script).

I have attached the QVW file please let me know if anyone can help me here.

Regards,

Pooja

Labels (1)
2 Replies
Anil_Babu_Samineni
MVP
MVP

What are you expecting?

Usually, we can calculate Ranks are like below

1) Rank(Expression)

2) Set Rank

3) From script you can try this too

if(Expression=previous(Expression),peek('Rank')+1,1) as Rank

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Kushal_Chawda
MVP
MVP

use below expression

=rank(total sum(if(Dept='Sci' and Subj = 'science', Amount*10,

if(Dept='Sci' and Subj='chemi', Amount*5,Amount))),0,1)