I am looking for a way to select top ranked overlapping segments. The table will look something like this:
CODE START STOP RANK
shift 2016-07-20 05:00 AM 2016-07-20 08:00 AM 5
late 2016-07-20 05:00 AM 2016-07-20 05:08 AM 1
break 2016-07-20 06:00 AM 2016-07-20 06:30 AM 2
This is what I would like my output to be:
CODE START STOP
late 2016-07-20 05:00 AM 2016-07-20 05:08 AM
shift 2016-07-20 05:08 AM 2016-07-20 06:00 AM
break 2016-07-20 06:00 AM 2016-07-20 06:30 AM
shift 2016-07-20 06:30 AM 2016-07-20 08:00 AM
In general, I would only like to see what the top ranking segment says about this human condition, but if they had no condition other than the standard “shift” segment, just show that they are on shift.
It makes sense? Please resolve any issues or suggested solutions. It seems I can not imagine anything at this moment. I can choose segments with the highest rating, but not when they overlap.
: , , ( , ) 05:00 05:08, 05:08 , , , 05:08 06:00.
06:00 06:30 , . 06:30 08:00, .
, .