Hello fellow KNIMErs,
I have an Excel file from my client that contains carrier data with expected times of arrival.
I need to calculate the working days in minutes from two date/time columns.
Attached is such a file. The last column contains the formula that the client wants me to use:
data-week19_mod.xlsx (3.4 MB)
I tried to re-use (and modify) the workflow that andrejz thankfully provided here: Calculating the number of working days between 2 dates in KNIME - #9 by andrejz but it wouldn’t generate the same results.
Does anyone have an idea how to do that?
Are you sure that the Excel formula is OK … If you look for example at the line 65167 in Excel the dates are 8.05.2021 19:12 and 17.05.2021 20:00. The total days between dates is 10 (the first day is Saturday), working days are 6. So if you do not count Saturdays and Sundays the correct result should be 8.400 (5 full days * 1440 minutes + 20 hours*60 minutes) and not 11.568 … or I am missing something?
You are right @andrejz, the formula is not very accurate. In this case the customer has a different calculation if the first day is a Saturday. I think I can figure out those exceptions.
There is one thing I don’t understand with your workflow. For example for this line:
This is Wednesday to Wednesday with one weekend in between.
The relevant part of the formula for this case is the last IF statement:
and the Excel result is 7022. The result from the workflow is 7074.
Would you have an idea how to deal with this?
I have made this workflow (is not finished yet …filter unnecessary columns and concatenate the two tables) … The idea is to calculate the difference if the date is the same. if the date is not the same exclude the first and last day an calculate the working days between the other days and then at the and add the minutes of the first day and the last day if they are not Saturday or Sunday
Difference in minutes.knwf (2.7 MB)
Hope this helps you
Thanks a lot for your help, @andrejz.
I’ll see if this gets me closer to the Excel results.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.