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

Hi I have a table that I need to determine the min and max time of 2 or 3 data time points...that is limited within hour of each point if it's greater I excluded

 

my data looks like this

 

id.     Number.      Start time.                      End time

1a.       23.           01/01/16. 11:01:00.        01/01/16 11:05:11

1a.        24.          01/01/16 11:02:00.          01/01/16 11:06:16

1a.       25.            01/01/16. 12:00:00.        01/0116 12:07:00

 

what I need here is just number 23 and 24 sine they over lap the 25 it exceeds the hour from the first 2 ....I would need 23 and 24 in one roll

id. Number. Start time. End time.                         Id.  Number.                Start time.                           end time 
1a. 23. 01/01/16. 11:01:00. 01/01/16 11:05:11.  1a        24                   01/01/16. 11:02:00.          01/01/16 11:06:16

I would need the min start time of number and max end time from number first 

 

thanks in advance

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

And if there was 4 overlap how would you want it to look like? Each entry into a group?

 

You can use the lag function to create groups and determine if there's an overlap. Once your groups are assigned you can then use various transpose mechanisms to transpose your data. 

 

 

View solution in original post

4 REPLIES 4
Reeza
Super User

Can you have multiple overlaps?

What happens when there's no overlaps?

What do you want the final dataset to look like for all records, include only overlaps?

BETO
Fluorite | Level 6
Yes I'm grouping it by Id. So if there could be up to 4 overlap if there is no overlap than I don't need that I just need where there was overlap ...
For example out put

1a. 23. 01/01/16. 11:01:00. 01/01/16 11:05:11.  1a        24                   01/01/16. 11:02:00.          01/01/16 11:06:16

would be one roll for the ones that are over lap

Reeza
Super User

And if there was 4 overlap how would you want it to look like? Each entry into a group?

 

You can use the lag function to create groups and determine if there's an overlap. Once your groups are assigned you can then use various transpose mechanisms to transpose your data. 

 

 

BETO
Fluorite | Level 6
Sorry forgot to mention that i need min and max for example if we have 3 or 4 entries same id same number get the min and max from date time that falls within an hour of min an max longer than hr I will exclude it ...after that I would like to see if the min and max date time field overlaps with the other number but same id ... thanks again

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 1046 views
  • 0 likes
  • 2 in conversation