Basic requirement:
I need to replace the word NULL in a collection of columns with a KNIME missing value (?).
Easy solution:
Use rule engine to test whether the cell value is NOT the keyword (NULL) and return the value - if the value is NULL then no value is returned. Repeat rule engine nodes for every column (and add/remove nodes every time the table structure change - Aaaaaargh).
Desired solution:
Use Column List Loop Start and Loop End nodes to wrap a Rule Engine. Within the rule engine create a rule with the variable name to select column and return value from column if vale is not NULL (the same as the easy solution, but replacing the column name with the variable name for the column) i.e.
NOT $${ScurrentColumnName}$$ = “NULL” => $${ScurrentColumnName}$$
I have created a workflow demonstrating both approaches on KNIME Hub
Problem:
The desired solution with the loop and variable names in Rule Engine doesn’t work. Instead of recognising the variable as a reference to a column, rule engine treats the $${ScurrentColumnName}$$ as a string variable and returns the string value of the column name.
Is this the correct behaviour for the column reference, and if so, how can we include references to columns within rule definitions?