divide into column and place the result in a row

In knime I have a table like this:

x x-1
10 4
5 2

I would like to perform an operation between row 1 and row 2 of each column. For example

x x-1
10 4
5 2
2 2

Row 3 is the result of dividing between row 1 and row 2 of each column

In general it is much easier to do calculation between columns (it is not possible though to do it row-wise).

The easiest way I think you can achieve this is by:

  1. Transposing the original table ("flip it 90°-side-ways turning rows into columns and columns into rows)
  2. adding a new column with the calculation logic
  3. Transposing it again

Simple Prototype:
CalcInSeparateRow.knwf (77.1 KB)

Overview:

If it has to be without transposing then there are ways by using multi-row access in Column Expressions or the new Expressions node.

5 Likes

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