Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vikky612
Contributor
Contributor

Rank() and ignoring selections

Hi all,

I am trying to fetch  top 5  Student names on  KPI's based on their marks.And i want to ignore the selections in the expressions.

Below is the sample data 

load * Inline

[

NAME, Marks

Rupali, 100

Smita, 90

John, 70

Aditi, 60

Prachi, 50

Priya, 40

Rina, 20

Mehul, 10

Disha, 15

Isha, 35

];

My expresssion is FirstSortedValue(NAME, -aggr(sum({<NAME=>}Marks),NAME)) 

But it is somehow not working.Any thoughts on this is appreciated.

 

Thanks

 

2 Replies
agigliotti
Partner - Champion
Partner - Champion

maybe this:

FirstSortedValue( {<NAME>} NAME, -aggr( sum( {<NAME>} Marks), NAME ) )

I hope it helps.

vikky612
Contributor
Contributor
Author

 

Hey Thanks, your expression worked perfectly but i am also looking for number to be displayed 

I tried below expression 

sum({<NAME={'$(=FirstSortedValue({<NAME>}NAME, -aggr(sum({<NAME>}Marks),NAME)))'},NAME>}Marks)

it is perfect but i want to ignore few more fields , but it is not working  please correct me where i am going wrong 

sum({<NAME={'$(=FirstSortedValue({<NAME,ID1,ID2>}NAME,

-aggr(sum({<NAME,ID1,ID2>}Marks),NAME)))'},NAME>}Marks)