I want to keep the latest rows with the same ID and also the rows that match certain column values. Sample Input:
ID Timestamp Survey Outcome
12 11/26/2021 INCOMPLETE Survey
95 11/26/2021 INCOMPLETE Survey
95 11/27/2021 COMPLETE Survey
95 11/28/2021 RANG-But did not connect
12 11/29/2021 COMPLETE Survey
24 11/26/2021 RANG-But did not connect
24 11/27/2021 INCOMPLETE Survey
95 11/28/2021 RANG-But did not connect
24 11/28/2021 INCOMPLETE Survey
Here ID 12 has two values, so I'll keep the latest(11/29/2021) row. But for ID 95, once the survey is complete it can't have any other options like rang-but did not connect. So I want to keep the latest timestamps data and also keep those rows where once the data is complete survey but the latest data shows incomplete survey or did not connect (all data after seeing COMPLETE SURVEY).
So my sample output will be:
ID Timestamp Survey Outcome
95 11/27/2021 COMPLETE Survey
95 11/28/2021 RANG-But did not connect
12 11/29/2021 COMPLETE Survey
95 11/28/2021 RANG-But did not connect
24 11/28/2021 INCOMPLETE Survey```