Icon

Looping over all columns manipulating each - KNIME Forum (91438)

<p>Looping over all columns and manipulation of each<br><br>The workflow iterates over all numeric columns and negates the values in the column. The loop takes one column at a time, renames the column name to ANONYMOUS_COLUMN in the first rename node, changes the value in the math formula nodes and reverts the name to the original column name.</p>

URL: KNIME, Paths and Loops — Automate Everything https://medium.com/low-code-for-advanced-data-science/knime-paths-and-loops-automate-everything-213455788685
URL: KNIME Snippets — Rules and Conditions do apply https://medium.com/low-code-for-advanced-data-science/knime-snippets-3-rules-and-conditions-do-apply-72b6ffbd4c9f
URL: Adapted from: Looping over all columns and manipulation of each https://hub.knime.com/s/Ck4Q3ZW7PEUAyl4L

Looping over all columns and manipulation of each

https://forum.knime.com/t/legacy-column-expression-node-to-new-expression-node/91438/2?u=mlauber71


The workflow iterates over all numeric columns and negates the values in the column. The loop takes one column at a time, renames the column name to ANONYMOUS_COLUMN in the first rename node, changes the value in the math formula nodes and reverts the name to the original column name.

The columns are collected in the loop end node and finally joined with the unmodified part of the original input table.

random data
Data Generator
rename toANONYMOUS_COLUMN(current column is given as a variable)
Column Name Replacer
rename toANONYMOUS_COLUMN(current column is given as a variable)
Column Name Replacer
revert name
Column Name Replacer
some math
Math Formula
Expression
attach unmodified columns
Joiner
one column at a time
Column List Loop Start
revert name
Column Name Replacer
attach unmodified columns
Joiner
column(variable("currentColumnName"))*0.25
Column Expressions (legacy)
one column at a time
Column List Loop Start
Reference Column Resorter
Loop End (Column Append)
attach unmodified columns
Joiner
all columns ofinterest go top output
Column Splitter
Reference Column Resorter
Reference Column Resorter
Extract Table Spec
one column at a time
Column List Loop Start
Loop End (Column Append)
Loop End (Column Append)

Nodes

Extensions

Links