Missing value node does not replace ? sign

Hi @clos
Thank you for uploading the file. Yes this confirms that it does indeed contain the literal “?” as data items, rather than having missing values. See how in the following output from the CSV Reader, they are black.

If you want the Missing Values node to be able to work on these, then you would have to convert “?” to “missing values” first.

As @gonhaddock has said, you can do this with the Rule Engine in a column loop to convert these.

Another way of doing this, using a single node would be to use String Manipulation (multi-column) node

Copy and paste the following code into that node:

$$CURRENTCOLUMN$$.equals("?")?null:$$CURRENTCOLUMN$$

You need to specify all of the String columns that might be affected by the presence of “?” values, as the function will work only on string columns, but that should be ok since numeric columns cannot contain a “?”.

Once that runs, the output will look like this, and you can see that the ? symbols are now red. As mentioned before, these cells no longer contain “?” but instead KNIME is displaying a red question mark to signify missing value.

After this, your missing value node should work as expected.
forum - missing values.knwf (414.5 KB)

I just realised that I’ve been here before :wink:

5 Likes