I have a table with N number of columns with 100+ rows. I would like to set a loop with a math operation of column 1 * column 2 and replace column 2. Then i would like to use the output of column 2* column 3 and store that as column 3 and continue it till n columns.
I was planning on using recursive loop with column nme regex and then math operation, column name regex and then loop end. I am not sure if there is a better way to do it and also running into column naming issues within the loop.
I would appreceiate if there is an example workflow that i could refer to.
that is a little bit of a setup you need.
Do you need about the Column Aggregator which can aggregate the results of multiple columns?
If you want to do this recursively. You need to work with the Recursive Loop with 2 Ports! One is keeping the waiting columns and the other stores the result of previous calculations. I will attach you a workflow showing how the iteration works.
In the end you only have one column and can join it with your previous results if necessary
Thanks for the example. As an output of the recursive loop i want columns 1 through column n after performing the math operation. This example just gives me one output column which is what you had mentioned as well.
We don't have a Column Append Loop end which works for the Recursive loop nodes..
But you can set the Recursive Loop End to save all data (not only the one from the last iteration) And Add the iteration number. Than use a pivoting node to get the desired data table.
Thanks. Does not seem to be working the way i would like it to. Changing recursive loop end to append iteration number seems to error out with number of rows and columns not matching. Will try it in Java/R node.
I upload you a modified workflow, which demonstrates the behavior mentioned above.