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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

Rank over time

Hi all,

I want to have a line chart where multiple clients can be selected, and the clients' rank of sum(revenue) is plotted over month. Right now my dimension is Month and Client, and expression is rank(sum(revenue)).

But if I select a client, the rank is 1 on each month. How can I change the expression to correctly express the client's revenue rank in the month over time?

13 Replies
sifatnabil
Specialist
Specialist
Author

Cheers! Also, what does adding avg(1) actually do to the rank?

sunny_talwar

Avg(1) Doesn't do anything to the Rank. It just remove those rows from viewing where the client has not been selected. This is needed because Rank(Sum({<Client>} revenue)) will disregard selection in client field and will show all the clients and you somehow need to delete them. That's where Avg(1) kicks in.

sifatnabil
Specialist
Specialist
Author

How did you know to use avg(1)? It seems like a completely unrelated function!

sunny_talwar

Whenever you don't want your expression value to change, but still want to show selected values, I try to use Avg(1). I guess it might not be straight forward, but if you use this often, this should become fairly intuitive.