I have data like:
Day Current Previous Growth
1 10 5 1.0
2 20 10 1.0
3 30 15 1.0
etc.
I would like to add another variable that creates a running total (RT) and running growth rate:
Day Current Previous Growth RT_Curr RT_Prev RT_Growth
1 10 5 1.0 10 5 1.0
2 20 10 1.0 30 15 1.0
3 30 15 1.0 60 30 1.0
etc.
Is there an easy way to do this in SAS? Datastep?
Thanks!
Totally forgot about that !!! Thx!
I can't determine from your example how running total growth is computed. Nevertheless, running totals are simple.
data want;
set have;
rt_curr+current;
rt_prev+previous;
run;
Totally forgot about that !!! Thx!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for 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.