How to fill columns based on conditions from other columns

Dear KNIME community,
I would like know how to solve the following problem:
We need to fill one of two cells of the output file based on the content of a column from the input file.

For simplification let’s assume the following:
File 1, Column A “Indicator”, Column B “Values”
File 2, Column C “Actual Values”, Column D “Forecast Values”

if Column A is “Actuals” then we need to insert the data from Column B “Values” in Column C of File 2.

Most likely we will need a loop that would look into each cell of File 1-Column B and fill either Column C or D in File 2.
Could anyone give us a hint on how to solve such problem?

Hi @marianaaamaro and welcome to KNIME Community Forum,

You don’t need a loop to do this. Just use a Row Splitter and split the rows based on the value of column “A”, then for each branch follow your desired approach (filling column C or D in file 2).


1 Like

Dear @armingrudd thank you so much for your suggestion!
It definitely solved more than one problem of the workflow I am working on.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.