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: 
fishing_weights
Contributor III
Contributor III

Accumulative sum of a field between two dates and return only the top 2 in 2 different objects

I have a staff table: 

Date  Staff KPI (1 = yes, 0 = no)
2021 JOHN 1
2021 PAUL 0
2021 ALLAN 0
2020 JOHN 1
2020 PAUL 1
2020 ALLAN 0
2019 JOHN 1
2019 PAUL 0
2019 ALLAN 0
2018 JOHN 1
2018 PAUL 1
2018 ALLAN 0

 

I need to show the top 2 staff in different objects in the dashboard base on the year the user select + the previous year.

Example if the user select 2020,

for John it would be 2020(1) + 2019(1) = 2

for Paul it would be 2020(1) + 2019(0) = 1

and for Allan it would be 2020(0) + 2019(0) = 0

First Object would then show: Top Staff = John

Second Object would then show:  2nd Runner up Staff = Paul

Is there a function to do this?

Thanks in advance

0 Replies