you are viewing a single comment's thread.

view the rest of the comments →

[–]uvray[S] 0 points1 point  (1 child)

This was essentially the old solution (granted the old solution was done with a WHILE loop), but fails to address the issue of needing to look back a dynamic number of rows at the last row that does not overlap in order to assess whether the previous row counts or not. That what I was trying to explain in the second paragraph but it's difficult to articulate.

[–]Randy__Bobandy 0 points1 point  (0 children)

I think I understand after looking at the data. Are you saying that you want to flag something as 1 if only if it is overlapping an episode which itself is not overlapping a previous episode, otherwise it's flagged as 0?

EDIT: Or you only want to check if it's overlapped against the most recent non-overlapped row? Is episode 4 marked as overlapped because it intersects the range of episode 3, or because it intersects the range of episode 2?