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: 
Anonymous
Not applicable

Value of highest count

Hi all,

I want to get the value which belongs to the highest count. So:

Name:     Count:

Paul      1

David     1

David     1

Harry     1

David     1

So, now I want an expression which gives David as a output as he has the highest count.

Thank you!

1 Solution

Accepted Solutions
sergio0592
Specialist III
Specialist III

Hi, try with :

=FirstSortedValue(Name,-aggr(sum(Count),Name))

View solution in original post

3 Replies
sergio0592
Specialist III
Specialist III

Hi, try with :

=FirstSortedValue(Name,-aggr(sum(Count),Name))

Anonymous
Not applicable
Author

That worked, thanks!

Monicalingan
Contributor III
Contributor III

Hi Joost,

Few more ways

=if(Right(Text(Name&'/'&Rank(Count(Name))),2)='/1',Name,'')

or

=if(Right(Text(Name&'/'&Rank(Sum(Count))),2)='/1',Name,'')