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

Hi team I'm working on 2 tables an I need to determine if table1  service A was done within 2 min of table2  service B..

And also  to determine how many  service B  did not have any service A here is example

TABLE 1

ID.    Ser    Start.                                        End

Qw.    A     23May2016:00:34:00.     23May2016:00:40:00

TABLE 2

 

ID.    Ser    Start.                                        End

 

Qw.   B    23May2016:00:35:00.     23May2016:00:41:00

 

In the example table One open within 2 min of the 2nd service I would want to see table two in a dataset

That's first part  here is 2nd part 

TABLE 1

 

ID.    Ser    Start.                                        End

 

Qw.    A     26May2016:00:29:00.     26May2016:00:40:00

 

TABLE 2

 

ID.    Ser    Start.                                        End

 

Qw.    A     26May2016:00:38:00.     26May2016:00:40:00

On this example what it's showing is there was a service B but no service A open up within 2 min I would want that on its own dataset .... thanks again  for help ay

 

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20
Perhaps a SQL right join with a table1.end between table2.end - 2 minutes and table.end + 2 minutes join criteria (pseudo code)?
Data never sleeps

View solution in original post

1 REPLY 1
LinusH
Tourmaline | Level 20
Perhaps a SQL right join with a table1.end between table2.end - 2 minutes and table.end + 2 minutes join criteria (pseudo code)?
Data never sleeps

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1110 views
  • 0 likes
  • 2 in conversation