How do you handle repeating steps

I have many columns. I want to divide the cells in column 2 by the cells in column 3, than I want to do the same with column 4 and 5 and so on. How can i do this in Knime? I don't want to repeat the instructions for every column pair.

Thanks for help

Best regards

wbart

Hi Wbart,

When performing such tasks in KNIME you are mostly interested in row wise execution. Then you could apply a Math Formula node and get a result between two (or more) columns for each row.

For a pairwise column comparison we currently do not have an execution model. For such a specific task you would need to either write a script with R/Java/Python Snippet node or setup the workflow using individual nodes.

Hope it helps.

Best, Daria

I haven't tried this but you might be able to achieve what you want without scripting by doing something like this:

  • Transpose the source table so rows become columns and vice versa
  • Use a rule-based row splitter to split the table into two, one half containing the dividend rows (formerly columns) and the other half the divisor rows.
  • Transpose the two tables back again
  • Use Extract Table Spec on each one to get a list of the columns it contains and join these into one table with two columns
  • Use a Table Row to Variable loop to give you the names of one pair of columns each iteration
  • Use Math Formula to divide these two columns

Like I say, I haven't tried this!

@Tom: Nice solution!! Worth a try.

Thanks. It is so complicated :(