The data I have looks like the picture below. I have the date, the customer name, and the different categories of fruit that they bought.
I want to create a new column that count how many "double sold" occurred. For example, first interaction with customer A is on 1/15, if the second second interaction is within 7 days of the first interaction and a fruit is sold, I want it to put a 1 in the "double sold" column.
Essentially, I want SAS to match the customer ID, and then go down the rows and look for dates that are within 7 days of the first one.