“Is it possible to fill two columns at the same time using column expressions?”
Let’s imagine a simple scenario:
I’m using column expressions to create a calculation.
This calculation will generate the result of a “total” value per item.
Then, I will need to create another column to calculate the unit value (which would be a simple division between the total value and the quantity, resulting in the unit value).
However, since I depend on the first calculation being computed, I have to use another node to create the unit value column. In other words, I have to use two nodes.
Now comes the question: what if I use only one column expressions node, but I already create the names of the other columns, as below:
Now, imagine that in the calculation I’m setting up for the total value column, the node is iterating on the first row, at this moment the calculation finds the total value, then I save the total value in a variable and divide it by the quantity, which is also in the first row of the iteration. The result is saved in the variable and I print the variable in the other column with the name of the variable.
By doing this, I could be filling both columns at the same time, with the same node.
I’m not sure if the explanation is clear;
P.S: If it’s not possible using column expressions, is it possible to use another node for filling in multiple columns at the same time (but always in the same row of iteration) during some primary calculation?
I have played with Column Expressions node and found out that:
Newly create columns are unavailable on the list of columns while creating next expressions.
Newly created variables are unavailable on the list of variables while creating next expressions.
Thus, I would say there is nos SIMPLE way to use output of one expression as the input for the next one.
@Kazimierz is correct. Unfortunately the formulas / expressions don’t calculate in series, so you need to string together multiple Column Expressions nodes in a row to reference prior variables / calculations.
I know it is on the development radar, but they are hard at work on the new V5 browser based KNIME AP. I wouldn’t expect it to hit the top of list soon.