@Patrick , seems like the below code is working I tested the same per the data, I believe for the record id 3 we should have only one row of -300 as it is the minimum values under ID 3
data have;
input ID Date:ddmmyy10. Points;
cards;
1 1/01/2019 0
2 1/01/2019 -200
3 1/01/2019 0
3 1/01/2019 0
3 1/01/2019 0
3 1/01/2019 0
3 1/01/2019 0
3 1/01/2019 0
3 1/01/2019 0
3 1/01/2019 -100
3 1/01/2019 -100
3 1/01/2019 -100
3 1/01/2019 -100
3 1/01/2019 -100
3 1/01/2019 -100
3 1/01/2019 -100
3 1/01/2019 -300
3 1/01/2019 -100
3 1/01/2019 -100
3 1/01/2019 -100
4 1/01/2019 -200
5 1/01/2019 0
5 1/01/2019 -200
5 1/01/2019 -100
;
proc sql;
create table want as select id,date,min(points) as points
from have group by id,date;
quit;
... View more