I’ve been reading through the forum and found some interesting comments on replacing empty/missing values with text. In Alteryx I could use the formula tool to replace null values with a chosen text. In KNIME, would I use the String Manipulation tool or the Missing Value node?
I’m not sure how to go about it and have tried them both but am stuck. Please help!
What are you exactly stuck at? If you could share a small example of your use case then it’s easier to determine what the most efficient route is to get your expected output.
If you are replacing it with a single static text value, then use the Missing Value node. Otherwise use MISSING in the Node Engine, or isMissing (or a test for null) in the Column Expressions node.
You can also use Missing Value to turn “null” values into “empty” string values, then process the conditional change in the String Manipulation node.
So this is how the input looks like:
And this is how I would like it to look like (so ? becomes Unspecified)
Does that help?
That is simply the missing values node. Go to the second tab, select the column you want to change, then select Fix Value, then enter Unspecified.
Or you can apply it to all of the string columns at once on the 1st tab.
I just tried this and I got an error message. Is there another way around this? I just want to replace all the ? (which either means empty or missing) with the text “unspecified”
Empty is actually “” - missing / null displays as ?
I have never seen an error when the missing values node is used on a string column. Can you save / upload a workflow that has some unrestricted dummy data in it for us to look at. This can be done by going to file, selecting Export KNIME workflow, and unselecting “Reset” option before exporting.
KNIME_project.knwf (13.1 KB)
Take a look at this workflow and see if you can use it to spot the problem on your end as well.
If the questionmark is a string you need to replace the string value e.g. with string manipulation node.
A missing value in KNIME is an actual completely empty cell in your data
I managed to fix it!! Thank you
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.