BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RPYee
Quartz | Level 8

Need to join Svc1 with Svc2 for TTLSVCNeed 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

___________________________________
The fact that I ask for help simply means I am inexperienced and under-educated. Please don't assume I am incompetent and uneducated.
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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 TTLSVCNeed 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


 

 

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
novinosrin
Tourmaline | Level 20

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;

Reeza
Super User

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 TTLSVCNeed 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


 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1052 views
  • 2 likes
  • 4 in conversation