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