Need to join Svc1 with Svc2 for TTLSVC
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:
Need to join Svc1 with Svc2 for TTLSVC
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:
Need to join Svc1 with Svc2 for TTLSVC
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
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.