Replace specific row values of a column with NULL values

Sometimes Rule Engine, Variables and Null values can be tricky. I have added an example where you could define your own replacement rules. Age gets replaced by NULL and gender by “NA”.

Please note:

  • there is no generic NULL in the Rule engine but ipazin came up with an clever solution (Create or replace column with NULL values) - create a column with just missing and use that
  • you would always need a TRUE rule that covers everything else. If you do not have one you will create missing values
  • you could deal with missing values later with the missing value node

image

The rules are defined in Excel and are then applied in a loop in KNIME

image

kn_example_replace_missings.knwf (47.1 KB)

4 Likes