Solutions to "Just KNIME It!" Challenge 4

This thread is for posting solutions to “Just KNIME It!” Challenge 4. Feel free to link your solution from KNIME Hub as well!

4 Likes

Here’s is my solution for the Just Knime It! Challenge 4

3 Likes

Here is my solution:

3 Likes

Hello KNIMErs,

Here is my solution to #justknimeit-4 :

KNIME Hub > gonhaddock > Spaces > Just_KNIME_It > Just KNIME It _ Challenge 004

image

BR

2 Likes

Hello!

Here’s my solution to the challenge.

image

3 Likes

just knimed it my self :))
image

3 Likes

I’m Node Golfing this question again. I’m using something that felt natural to me, but was apparently not so obvious to others, so I should mention it:

Declaring variables in the Java Snippet node at the place the editor tells us to actually creates global variables that retain their value between rows. Variables declared within the expression section do not have that property. You can read more about that in @takbb’s wonderful thread here:

That “feature” allows us to skip the lag column, because it allows the Java Snippet “retrograde row access”. It’s quite simple: Store the price value in a variable to compare against it in the next row. To prevent accessing an uninitialised variable, shortcut evaluation in if-tests is leveraged in row 0.

PS’ses:
@goodvirus your lag node drops the first row the way you configured it
@gonhaddock There’s a file with sample data in the challenge post. Your very interesting solution works with the actual data just as fine though :wink:

3 Likes

image
image


Solution in 4 steps

If I wanted it to be more foolproof, I would add a sort by date, and some other handlers for missing values etc.

2 Likes

here is my solution
image

1 Like

Hi, here is my solution KNIME_challenge_4 – KNIME Hub

1 Like

Hi everyone,
Here is my solution

1 Like

For those who want to have a look.

Here’s my 3-step solution:
https://kni.me/w/amVAesAJwqniUh_M

1 Like

Here is my solution

the expression for calculating change column is probably the most interesting bit.
image

2 Likes

Sorry the boring solution… but is here we go

  1. Sorted by date just in case
  2. Din´t chek if there are missing data but if it is will counted as change
1 Like

the node: ORDER DATES, is not necessary if the data come sorted

image

the node: ORDER DATES, is not necessary if the data come sorted

justknimeit-4 ver 1 – KNIME Hub

1 Like

Just learn a new node - Lag Column !

3 Likes

@Thyme: Thanks for the heads up, I updated my flow. Also cool trick with the java node, that will come in handy next time I have to access the previous row and don’t want to waste memory.

1 Like

Here is mine, using a similar approach like the other KNIMErs

Interesting for me was to learn about the Lag Column Node which I didn’t know and which helps me to replace those nasty MS Excel cell fixation formulas (you know, these $B5 kind of things :wink: )

2 Likes

Hi KNIMErs,

Here is my solution.

Best Regards,
Roland

1 Like