Hello,
I have a dataset that looks like this:
year | orig | dest | flow |
1990 | AT | BE | 456 |
1990 | AT | DE | 356 |
1990 | AT | DE | 21 |
1990 | BE | DE | 235 |
I would like to sum the column "flow" when year, orig and dest have the same value. For instance, in that example, the dataset should become:
year | orig | dest | flow |
1990 | AT | BE | 456 |
1990 | AT | DE | 377 |
1990 | BE | DE | 235 |
Is there a simple way to do this?
Post test data in the form of a datastep!
proc sql; create table WANT as select YEAR, ORIG, DEST, sum(FLOW) as FLOW from HAVE group by YEAR,ORIG,DEST; quit;
As a guess.
Post test data in the form of a datastep!
proc sql; create table WANT as select YEAR, ORIG, DEST, sum(FLOW) as FLOW from HAVE group by YEAR,ORIG,DEST; quit;
As a guess.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.