Is it possible to perform multi-column conditional calculations with only "Column Expressions" node?

Dear all

The attached workflow uses a “Column Expressions” node and a “Math Formula” to perform the calculation.

The “Column Expressions” is used to extract the values for a specific condition.
The “Math Formula” performs a new calculation using the average value of the newly created columns.

Is it possible to perform this calculation using only “Column Expression” node?

Best Regards,

KNIME_project.knar.knwf (15.6 KB)

Dear Taka,

The Column Expression node is not able to process an entire column, it reads values row-by-row as it evaluates the expression you defined. Since version 4.6, you can enable multi-row access as well by using the Advanced tab of the node configuration window, but still, you have to specify exactly how many preceding and following rows of the current row you want to access. So this does not allow to calculate values (average, min, max etc.) for an entire column. For this reason, I think your 2-node approach is more convenient to use.
Could you tell why you would prefer a single-node approach?

Best regards,
Dóra

5 Likes

Hi dorabarna,
Thank you for very helpful reply.
I asked the question because I thought it would be simpler if the nodes were merged into a single node. I understand that “column expressions” and “math formulas” are the right choice to do what I want to do. Thank you! :smile:

2 Likes

Hi Taka,
Indeed, it would be more simple to solve it with a single node instead of using two. Unfortunately, the Column Expression node does not support this case.

Best regards,
Dóra

1 Like

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