I’m stuck in a four nodes solution as well, too low for the whole week
BR
PS.- I saw your KNinjas interview… congrats to the participants! … and thank you to the KNIME team for proposing these interesting challenges; I personally learn with all of them.
I assumed that the barely structured table was part of the challenge and ended up spending all of the time trying to dynamically parse the structure to a table format.
the trick of the table format was the varying column delimiter using regex. I didn’t wanted to go for the fixed position as you’d be forced to hard type pos and name (or suffer significant amount if nodes)
I’m pretty sure that I stumbled upon a bug in the “Column Expression” node while using regexReplace as it returns a “Nullpointerexception” if the replace statement is not valid. I circumvented it by adding a try/catch statement in the formula, as that is probably missing in the underlaying java build. @tobias.koetter
I’m seeing a tendency of using as little nodes as possible with weird clever tricks. It’s the same as with programming. Once you come back to it to do maintenance you will have trouble understanding your own tricks unless you comment (or in case of KNIME annotate) your work.
It’s a nice theoretical exercise but I think it is bad advice for newcomers. Using many in itself simple and understandable steps is much easier to track after the fact. And you can then just collapse them into a metanode or component and name it correctly.
Not quite certain if anyone noticed yet but in the expected result table seems to be a mistake.
Example table
Index
Online
Onsite
1
A.6777-01
2
7736-01
3
L-2210341175-00-000020
4
L-3210341175-00-000020
5
F5454
6
B_7736-01-00-000020
7
F5454
7736-01
Expected Result Table
Index
Online
Onsite
Product Codes
1
A.6777-01
677701
2
7736-01
773601
3
L-2210341175-00-000020
221034117500
4
L-3210341175-00-000020
221034117500
5
F5454
F5454
6
B_7736-01-00-000020
773601
7
F5454
7736-01
773601
Index no. 3 “L-2210341175-00-000020” should result in “221034117500” which is correct. However index no. 4 is said to also result in “221034117500” but actually should be “321034117500”, shouldn’t it?
@kienerj You’re absolutely right, optimisation should never turn into “code obfuscation”.
This is why I’m trying to stick with standard nodes (i.e. no scripting, no extensions) when answering forum questions. Also holding back with smart tricks etc.
However, with the Just KNIME It challenges, nobody is looking for help. We can be creative with our solutions – and they are quite diverse!
I think that’s one of the goals behind these challenges: To bring a multitude of solutions together so we can learn from each other. I do wild optimisations (single node Java Snippets are my favourite), other people make beautiful dashboards.
Hi everyone !
My solution to this challenge. I really liked it because we can train ourselves in matters of manipulating strings and with help of regex patterns, we can infer the desired codes, all with only one Column Expressions Node:
here is my solution to this challenge: justknimeit - 13 - Raffaello Barri – KNIME Hub
I decided to keep it simple and used just three nodes. Inside the Column Expression node you can find the task of the challenge. I used regex to extract digits (discarding letters and punctuation) and substr() to cut the required number of digits.
I Lost the train on challenge 07 , I trying to catch up.
Here is my solution to this one
Solved 2 ways , one using only one node , columns expressions .
And for the second one a combination of rule engines .
Personally I think that the second one is better, I always get confused with the IFs and ifs combination