Solutions to "Just KNIME It!" Challenge 20

This thread is for posting solutions to “Just KNIME It!” Challenge 20.

Here is the challenge: Just KNIME It! | KNIME

Feel free to link your solution from KNIME Hub as well!

Have an idea for a challenge? We’d love to hear it! :heart_eyes: Please write it here .

And remember: the more you participate, the more participation badges you may end up getting. Fancy, huh? :wink: Just remember to correctly mark your solution in the Hub with tag justknimeit-20. :grin:

1 Like

This is my solution

4 Likes

Hello Knimers,

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).

RB

2 Likes

Hello guys,

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 :slight_smile:

Ilkka

1 Like

I liked the use of lag columns!

2 Likes

Hi!

My first participation. This is my solution without loops and using a date dimension table.

justknimeit-20-HLezano

HL

4 Likes

1 Like

Here’s my solution.

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).

image

cheers

3 Likes

Hi everyone,
Here is my solution.
No loop.
Used Java Snippet and code from (Calculate number of weekdays between two dates in Java - Stack Overflow)

1 Like

Hi,

Here’s my solution to the JustKnimeIt Challenge 20. Wasn’t able to come up with a solution without Loops. Used some Nodes from a workflow I found on this thread: Calculating the number of working days between 2 dates in KNIME

1 Like

Woohoo! Super cool, @Hlezano!

Thanks for your solution, @ChloeDevine638, and welcome to our community! :smiley:

1 Like

Hi Knimers,

This

is my solution without loops.

Best Regards
Andrew

3 Likes

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

3 Likes

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.


2 Likes

My Submission for Challenge 20

  • Miss the Loop - node in disguise
2 Likes

This is my solution.

2 Likes

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 :wink:).

4 Likes

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.


image

3 Likes

Yes, this one was hard. hehe Thanks for sharing your solution and experience with us!

2 Likes