Suppose I have sorted sample dataset looks like this CustomerID CallID Date 123 1 01/30/2017 123 2 01/30/2017 123 3 02/03/2017 123 4 02/07/2017 123 5 02/08/2017 I want to count how many calls did I received from the same customer in the past 7 days as of each date. The desired output dataset would be CustomerID CallID Date NumOfCallsInOneWeek 123 1 01/30/2017 1 123 2 01/30/2017 2 123 3 02/03/2017 3 123 4 02/07/2017 2 123 5 02/08/2017 3 Note as of 02/07/2017, the 2 calls on 01/30/2017 are received over a week ago, so they are not counted. How could I do it using either data step or proc sql? Could someone please help me? I'd really appreciate it!!! Thank you!
... View more