I have a table with 20 columns. I wonder if there is an easy way I could filter in columns two-by-two (not manually selecting all the time) via any loop node? For example, I need to loop first 2 columns (column 1&2) and do some manipulations with them, then loop next 2 columns (column 3&4), etc.
Or would transposing then chunk looping be the only way?
Maybe you can use Extract Column Header and a chunk loop to achieve what you want? You will still have all columns in your loop, but the current columns can be made available as flow variables.
You have to select two columns an then filter that two columns. For the first task @AlexanderFillbrunn gives you the solution for the second part, how to filter columns you can see some solutions here: Select first n columns of a table
I think you need a Transpose node and a Chunck Loop. At least I needed both to create a solution. See this workflow looping_a_certain_number_ of_columns.knwf (29.7 KB) . You can adjust the number of columns you want to some calculation on by modifying the Chunk Loop setting and adding another row to the Table Creater node.
Hi there @Odko,
can you tell us more about your use case? What are you doing with columns in loop? Also is number of columns fixed and are columns names same?
Dear @AlexanderFillbrunn, @andrejz, @HansS, @ipazin, thank you so much for your kind and timely suggestions.
I followed the way I was first talking, i.e. transposing and chunk looping, as the task was quite urgent. It worked for me. Here is the workflow:
I needed to filter in every 2 columns (as a pair) in a non-repetitive way (i.e. if I selected first two columns, then they are not selected in next iterations) and multiply them and get a value.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.