Dynamic loop over columns based on user selection


I’m working on a flow indented for a user to select a month and all values in months prior to user selection shall be missing/empty values. E.g. user selects month of April, all months from October through April shall be missing or empty.

I already have a loop over reach column that multiplies all columns with -1. I was thinking of using the same loop to determine, if values should be either multiplied with -1 or simply deleted/replaced with 0, but I’m stuck in the dynamic selection of columns. Does anyone have an idea how to do this?

This is how the output should look like, ideally. I’m using Constant Value Columns nodes to achieve this, but it’s very manual unfortunately and has to be changed every month.


Hi @Krau5i,

this could be a solution:

Select the month after a double click on the Compound Node and after then run this node.

Best regards

PriorColumnSelection.knwf (93.0 KB)


Thank you Andrew, this works exactly how I wanted it and I learned a lot about various nodes I had not used before. Really appreciate it!



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