How to replace missing values in one column with values from another column (e.g., fill missing values in “Column Header (right)” using values from “Column Header”)
You can do this with eg. column expressions node:
Prototype:
missingvalsfromothercol.knwf (74.2 KB)
Overview: (red highlighted cells were missing)
Formula:
if (isMissing(column("Header (right)"))) {
column("Header")
} else {
column("Header (right)")
}
@lca50666 or you could use the new Expression node:
if($[“Column_B”] = MISSING or $[“Column_B”] = NaN, $[“Column_A”], $[“Column_B”])
@HansS @MartinDDDD @mlauber71 Thank you to all the experts for your help. I chose the Column Expressions node to solve this issue.
@HansS … Small correction to the TRUE =>
line in the Rule Engine rule shown above
MISSING $Column Header (right)$ => $Column Header$
TRUE => $Column Header (right)$
br
@takbb sharp and alert as always
lol, always easier to be “sharp and alert” with other people’s code, when they’ve done the work, than I am with my own
I think this use case is what the Column Merger node is for.
You just need to make the “Column Header” column as the primary column, the “Column Header (right)” the secondary column, and then specify to populate results in the secondary column.
-Phil
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.