Feel free to link your solution from KNIME Hub as well!
Have an idea for a challenge? We’d love to hear it! Please write it here .
And remember: the more you participate, the more participation badges you may end up getting. Fancy, huh? Just remember to correctly mark your solution in the Hub with tag justknimeit-20.
I managed to avoid loops, but I decided to use code instead.
I used an R package called bizdays, which can be used to calculate the difference between dates in working days (in this case, holidays have not been taken into account).
Thanks for the interesting challenge! I wanted to test without code so I approached this by creating a date range between the start and end date, filtering out Saturday and Sunday and then counting the weekdays. I didn’t manage to avoid loops for this one
I took on the challenge on avoiding using loop. Besides a hairy loop in a Column Expression node, the only way I could come up with to calculate Network Days, was to use a Python-node, where numpy has a nice function ‘busday_count’. I didn’t use any custom packages and hence didn’t see a need for adding the Conda Environment Propagation node (of which I’m a fan).
This is an alternative solution, without loops, not even in the Column Expressions node. Actually, if you have the starting day of the week and the number of days in the period you can compute the “network days” with a single (quite ugly) Math Formula
Here is my solution. This one was harder and was a lot of fun. With a loop this would be pretty easy but without! I decided to go in on Java. I had a job years ago coding c# so it was fun to dig in. I created (OK, took some code from stack overflow) my own custom Java Network Days equivalent. I tested it against some excel generated data so I think it should be pretty solid.
Wow, I love how diverse these answers are. Some use Java, some R, some Python, and some keep it all within KNIME. My own solution is purely KNIME no-code (not even column expression; should have made using pure KNIME a mega bonus challenge ).
Good night everyone,
here is my take on this challenge. With a bit of code in Python, I managed to manipulate the input table and calculate the business/network days between hospital visits.
This can also be done in pure KNIME, maybe using rules and date ranges, with no loops.