04-25-2018 02:11 AM
04-25-2018 04:29 AM
Post test data in the form of a datastep, and what you want the output to look like.
proc sql; create table want as select "1 day" as cat,
from have a
left join (select account,sum(amount) as res from have where a.date -1 <= date <= a.date) b
Shows one way which may work to get the 1 day, same thing for 7 and 15.
04-25-2018 08:30 AM
If you post example data in a csv, you should also post the code you use to read that data into a SAS dataset. Only then can we recreate your dataset exactly as it is.