automatically look for columns which have similar/common names and sum them up?

I have a table with columns where column names have the first letters in common e.g. "bla_1","bla_2", "bla_3", .... and a lot of other columns. Now I want to sum up all "bla_x" columns (bla_1 + bla_2 + bla_3 ....). Doing this interactively is of course a trivial task with the math or java-snippet node. But I need an automatic way (loop over columns, check column names for common string an some up ) that works no matter how many of such "bla" columns I have, because the number of such columns changes with every run of my workflow . Bernd told us at the UGM that a "loop over columns" will come soon, that might enable a nice solution. Does anybody have an idea/workaround how this can be done now? Maybe it is trivial as well and I just don't see it? many thanks in advance for your help!

I dont know if I am misunderstanding the problem but can you use the Transpose tool first, and then Rule Engine to look for the string "bla_" and if so report "bla" in a new column. Then use the GroupBy node and select the new column, then select the data you want to sum up.

1 Like