Problem statement:
I am trying to solve a problem of continuity in time ranges and create a flag(continuous/gap).The goal is to evaluate all time values pairs and make sure there is no gap between time 11(start time) and time 42(end time). These time range sets will possibly go up in real world. So there might even be a Time81 and Time82 pair as well.
My dataset looks like this:
| Primary Key | Date | Time11 | Time12 | Time21 | Time22 | Time31 | Time32 | Time41 | Time42 | Flag |
| 1 | 11/11/2019 | 7:00:00 | 13:00:00 | 7:00:00 | 15:00:00 | 9:00:00 | 18:00:00 | 13:00:00 | 21:00:00 | Continous |
| 2 | 11/12/2019 | 8:00:00 | 18:00:00 | 9:00:00 | 15:00:00 | 15:30:00 | 21:30:00 | | | Continous |
| 3 | 11/13/2019 | 8:00:00 | 17:00:00 | 9:45:00 | 15:45:00 | 16:00:00 | 21:00:00 | | | Continous |
| 4 | 11/14/2019 | 8:00:00 | 13:30:00 | 14:00:00 | 21:00:00 | | | | | Gap |
| 5 | 11/15/2019 | 8:00:00 | 13:30:00 | 12:00:00 | 14:00:00 | 14:30:00 | 18:00:00 | | | Gap |
I was trying to work with something like this but I am getting to many false positives.
if
DateTimeDiff([Timings21],[Timings12],"minutes")>0
or
DateTimeDiff([Timings31],[Timings22],"minutes")>0
or
DateTimeDiff([Timings41],[Timings32],"minutes")>0
or
DateTimeDiff([Timings31],[Timings12],"minutes")<0
then
'Gap'
else
'Continuous'
endif
Any help or guidance is highly appreciated. Let me know if there is more clarity needed.
Thanks in advance.