Hello,
I have a data set that has each instances of payments made by account_id.
Here is the sample data.
data test;
infile datalines;
input id $ payment date yymmdd10.;
format date yymmdd10.;
datalines;
1 20 2010-01-31
1 20 2010-02-28
1 40 2010-04-28
1 50 2010-07-02
2 40 2012-01-31
2 50 2012-02-28
2 10 2012-03-28
3 100 2013-02-20
3 200 2014-02-01
4 400 2011-01-31
5 50 2000-01-31
5 30 2001-02-28
6 10 2001-02-02
6 10 2001-03-03
6 10 2001-04-02
6 10 2001-05-03
;
run;
Now I need to keep the rows for each id, until the payment(cumulative payment) is greater than 70. So the final output will look like as follows.
1 20 2010-01-31
1 20 2010-02-28
1 40 2010-04-28
2 40 2012-01-31
2 50 2012-02-28
3 100 2013-02-20
4 400 2011-01-31
5 50 2000-01-31
5 30 2001-02-28
6 10 2001-02-02
6 10 2001-03-03
6 10 2001-04-02
6 10 2001-05-03
Thank you for the help in advance.
PS
Methinks this is the same question I just responded to. No?
Methinks this is the same question I just responded to. No?
Yes you did
. Thank you.
Hi,
Is the problem resolved? If yes can you share the solution?
Vishal
Here is the link. https://communities.sas.com/thread/53243
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.