Date time difference with exceptions

Hi All,

I would like to calculate number of days between two dates, but there is trick in it:
I have an other table that contains dates, that shouldn’t be considered when calculating the days.

I would appreciate some proposal, how to implement it with Knime.
Thank you
DateTime_Diff.knwf (10.7 KB)

Hi Harry,

is something like this working?

The row with column1 = 2020-10-10 is cancelled.

RB

Hi @HarryKl,

You may be able calculate the number of days between two dates (excluding specific dates) by adding a few additional nodes to your workflow like this:

DateTime_Diff.knwf (51.2 KB)

Hopefully this is close to what you need!

Cheers,
Dash

4 Likes

I don’t think so.
How does this wf calcutate, how many days in the exception table exists in the individual date ranges?
Maybe I simply don’t understand your solution…

Wait, I might have misunderstood the task.
When you say “I have an other table that contains dates, that shouldn’t be considered when calculating the days.” you mean that if I find a date cointained in the exclusion list I should not make the calculation?

RB

Let me give an example:
startFDate: 2022-07-01
endDate: 2022-07-22

Without exception end minus start is 21

Exception list contains: 2022-07-03, and as this day is between start and date, the result is 20, as exception should not be considered.

I got it. Sorry but I misunderstood the task :sweat_smile: don’t consider my solution.

RB

Check out the solution by @dash_brookhart in this topic. You might have missed it, it does what you need :wink:

2 Likes

thank you, I missed it

Hi Dash,

thanks a lot, this is what I need.
Really appreciated !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.