I am pretty new to the KNIME Platform and was wordering if there is a way I can write a condition where based on the string input I am able to either select data from the column data from the row right above it or leave it as the same.
Using String Manipulation I was able to get this:
regexMatcher($Customer Name$, “XYZ”).equals(“True”)?string($$CURRENTCOLUMN$$($$ROWINDEX$$)):string($Customer Name$)
This only gives me the row index of the column above and not the data itself.
How I can I change this expression to give me data from Customer Name -1 row?
The data does not follow any particular sort of pattern.
Whenever ‘XYZ’ is found column Customer Name, the supposed value of the row should actually be the value found the previous row of customer name.
In the above example, Row 2 and 5 has ‘XYZ’ and should be replaced with data from Row 1 (‘ABC’) and Row 4 (‘CDF’)
I tried using the following expression within the string manipulation node excluding everything but the Customer Name Column on top: regexMatcher($Customer Name$, “XYZ”).equals(“True”)?string(($$ROWINDEX$$-1)):string($Customer Name$)
But whenever it identifies XYZ it just returns the Row ID of the row 2 above the one it finds it in.
Here’s a version which allows input of the name to be changed rather than having it hard coded in the Column Expressions node. Column Expressions Replace Row w Input.knwf (95.7 KB)