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!
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.