I have two query result sets as shown in example above. I need to combine the results of each for a total. I am having trouble finding documentation on how to do this in Enterprise Guide. I am a novice with no coding experience. I could also go back to the beginning and create a UNION on the two tables that each of these results were based on, but there are instances where I need the service types isolated, which is what I started off having them separate.
Thoughts and suggestions are much appreciated!
Rita Yee
Project Engineer
FedEx Express
I would suggest going back, unioning the tables and generating the results by service types. When you're doing your queries or tasks, there's usually the ability to add a GROUP BY variable, put the service variable into that field and it'll get you the results within a single table.
@RPYee wrote:
I have two query result sets as shown in example above. I need to combine the results of each for a total. I am having trouble finding documentation on how to do this in Enterprise Guide. I am a novice with no coding experience. I could also go back to the beginning and create a UNION on the two tables that each of these results were based on, but there are instances where I need the service types isolated, which is what I started off having them separate.
Thoughts and suggestions are much appreciated!
Rita Yee
Project Engineer
FedEx Express
You don't specifically state you want an SQL solution, so I give you a non-SQL solution.
Combine the two datasets into one, vertically. If you were programming, you would use the SET statement, I'm not sure the exact terminology if you are using Enterprise Guide (I think it might be "Append" or "Append Table". Then run PROC SUMMARY on the combined dataset, with Date as the CLASS variable.
Please paste the values as plain text and not as screen shots/pics, doesn't help
data temp;
set service1 service2;
by month;
run;
proc means data=temp nway;
class month;
var _numeric_;
output out= want SUM=/AUTONAME;
run;
I would suggest going back, unioning the tables and generating the results by service types. When you're doing your queries or tasks, there's usually the ability to add a GROUP BY variable, put the service variable into that field and it'll get you the results within a single table.
@RPYee wrote:
I have two query result sets as shown in example above. I need to combine the results of each for a total. I am having trouble finding documentation on how to do this in Enterprise Guide. I am a novice with no coding experience. I could also go back to the beginning and create a UNION on the two tables that each of these results were based on, but there are instances where I need the service types isolated, which is what I started off having them separate.
Thoughts and suggestions are much appreciated!
Rita Yee
Project Engineer
FedEx Express
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.