Hi,
Good Morning!! Looking to get some help from the community.
I have a dataset with transaction information for each customers and below is what the data looks like today.
Customer id Trans_date Transaction Amount Account Balance
12345 12-Nov-17 50 50
12345 14-Nov-17 40 90
12345 17-Nov-17 -25 65
23564 10-Nov-17 15 15
23564 18-Nov-17 15 30
Basically, every time a single transaction results in increase in account balance, is what I want to capture by customer id (highlighted in red).
Looking for some expert advice and help.
Thanks
--TJ
Use the DIF or LAG function to retreive the previous value or difference from previous value.
data want;
set have;
by customerID;
change=dif(account_balance);
if not first.customerId and change>0 then output;
run;
@BhararaTej wrote:
Hi,
Good Morning!! Looking to get some help from the community.
I have a dataset with transaction information for each customers and below is what the data looks like today.
Customer id Trans_date Transaction Amount Account Balance
12345 12-Nov-17 50 50
12345 14-Nov-17 40 90
12345 17-Nov-17 -25 65
23564 10-Nov-17 15 15
23564 18-Nov-17 15 30
Basically, every time a single transaction results in increase in account balance, is what I want to capture by customer id (highlighted in red).
Looking for some expert advice and help.
Thanks
--TJ
Use the DIF or LAG function to retreive the previous value or difference from previous value.
data want;
set have;
by customerID;
change=dif(account_balance);
if not first.customerId and change>0 then output;
run;
@BhararaTej wrote:
Hi,
Good Morning!! Looking to get some help from the community.
I have a dataset with transaction information for each customers and below is what the data looks like today.
Customer id Trans_date Transaction Amount Account Balance
12345 12-Nov-17 50 50
12345 14-Nov-17 40 90
12345 17-Nov-17 -25 65
23564 10-Nov-17 15 15
23564 18-Nov-17 15 30
Basically, every time a single transaction results in increase in account balance, is what I want to capture by customer id (highlighted in red).
Looking for some expert advice and help.
Thanks
--TJ
Thanks.. I ended up using the lag function and this worked.
--TJ
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.