data have;
infile datalines dsd;
input score dossier : $2. yearmonth flag $1. ;
datalines;
0,c1,201801,N
0,c1,201802,N
0,c1,201803,N
0,c1,201804,N
0,c1,201805,N
0,c1,201806,N
0,c1,201807,N
0,c1,201808,N
1,c1,201809,Y
1,c1,201810,N
2,c1,201811,Y
2,c1,201812,N
1,c2,201801,Y
1,c2,201802,N
1,c2,201803,N
1,c2,201804,N
2,c2,201805,Y
3,c2,201806,Y
3,c2,201807,Y
3,c2,201808,N
3,c2,201809,N
3,c2,201810,N
2,c2,201811,N
1,c2,201812,N
;
run ; Hello, this is a dummy table to ilustrate my need. for each row (each month) I need to count the number of Y among the last 6 period . the expected result is the column score thanks in advance for your help regards Nasser
... View more