Does anyone know if it is possible to add a null value to a row in KNIME?
I am trying to use the Rule Engine to remove some values, and substitute them with a NULL.
Regards
There is no syntax (as of KNIME 3.4.0) for declaring missing values from Rule Engine nodes. There are workarounds though:
If no rule matches, the outcome is a missing value.
... => $missingIntCol$
With the Rule Engine (Dictionary)
node the outcome column cannot contain missing values.)
Create a Dummy Null Column with a Rule Engine First and then use another rule engine to program what you need EG. $Example Column$ = "#" =>$Dummy Null" This will replace your # in the Example Column with Null Values
Hopes it helps
There is missingValue()
function in Column Expressions node which returns missing value in a cell. Column Expressions node is based on JavaScript syntax so following logic is possible:
if(column("column1")=="someValue") //create missing
{
missingValue()
}
else //take value from colum1
{
column("column1")
}
You can use a normal 'Java Snippet': Create the input and output via the lower menu. If you chose the 'replace' option for the output column you can replace the input values directly. Otherwise you have create a new column.
Here is example java code to paste and edit:
if(c_your_input>100)
{
out_your_input = c_your_input;
}
If the there is no matching with if clauses missing values are automatically created.