Hello, I want to subset the Input Table by comparing the Service Date of each Customer_ID. If difference in Service Date of a Customer_ID is within 7 days, then select only the observation with oldest date. If difference in Service Date is more than 7 days then select all the observations. Please see the Input and Output Tables below and help me with the Code. Input Table Customer_ID Transaction_ID Service Date AB1 12345 10/12/18 AB1 12346 10/14/18 AB1 12347 10/15/18 AB2 22233 6/10/18 AB2 22234 9/12/18 AB3 35678 1/5/19 Output Table Customer_ID Transaction_ID Service Date AB1 12345 10/12/18 AB2 22233 6/10/18 AB2 22234 9/12/18 AB3 35678 1/5/19 Thanks, Varun
... View more