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
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.
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?
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.