I'm a beginner in Knime and would like to manage the overlapping of several dates.
I have 2 columns like that, the first one for startdate and the second one for enddate (in Date/Calendar format) :
I have calculated some time operations like (startdate(i)-startdate(i+1)),(enddate(i)-enddate(i+1)) and (startdate(i)-enddate(i)) with the available (time)nodes in Knime, in order to deduce an algorithm. But no way.
Do you have already be faced to this problem ?
Thanks in advance,
what was the goal of your calculation? Could you give an example of the expected outcome?
Thank you for your quick reply.
The main goal is to identify if there is an overlap between each dates intervals and to extract the duration of the eventual overlap.
Like these 2 dates intervals :
<p>There is an overlap (a boolean = TRUE/FALSE), in this case it's TRUE. And to obtain the duration in days of the overlapping, in this case is 41 days.</p>
so that's not easy... I wold use the Lag Column node on both date columns.
so you will achieve in each row the previous and consequent interval.
For detecting an overlap you need to check different szenarios.
startdate1<startdate2 AND enddate1 > startdate2
startdate1>startdate2 And enddate2 > startdate1
Should output if they overlap.
for calculating the overlap you also need to check if one interval is included in the other.
I think if sorting the data by startdates is allowed, you only have to check if the previous row's enddate is greater than the current row's. (So Sorter, Lag and probably Rule Engine or Java Snippet.) I assume startdate < enddate for all rows.
If the goal is to compute all row's overlap, I think the best option would be to implement a distance function for time intervals (or date collections with the assumption of two values there). That way, you will get a (half) matrix of overlapping values.
Thank you guys, your advices help me a lot.