I’m using a String Manipulation node to join the relevant pairs of data from the column headers to make a new column with the merged data.
attribute1[a] - attribute2[a]
I’d like to automate this since there are multiple pairs. I’ve followed a few examples doing math on columns one at a time, but can’t modify this to enable multiple columns to be manipulated together simultaneously. Is this possible using Knime?
Hi,
Welcome to the KNIME Forum! It’s possible with some flow variables. You can use the Extract Column Header node to find all columns, then using some string manipulation you can extract the [a] part into a separate column. Then GroupBy that column and aggregate the original column name using the method “List”. Then expand the list into columns using Split Collection Column and then again a String Manipulation node to build the actual expression you want to use to join the two column values. Then use a Table Row To Variable Loop Start to loop through the list of expressions and in the loop you need a String Manipulation that executes the expression to create the new column. If you give me some example data, I can also build a workflow for you, but maybe you like the challenge to do it on your own
Kind regards,
Alexander