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