Loop through column headers as variables to be used in another loop

Hi Knimers,

I am not sure whether this topic has already been solved but I could not find a solution for my problem so far.

What I want to do it to use the column headers of a table as variables one by one, to filter one by one the columns in another data table. Basically I want to process one column of my data table per time and save every iteration in a final table. Is this possible?

I already extracted all column headers I need and converted them in variables with the Table row to variable node, but once the first iteration is finished the variable is not recognized anymore by my processing node, because it is expecting always the same, how can I use recursively all variables? :exploding_head:

I thank in advance whoever can help me!

Cheers,

Silvia

Hi @ChineS,

after extracting your column headers you have to transpose them to get the column headers in one column. Then you can use the ‘Table Row to Variable Loop Start’ node and iterate over all column headers.

BR

2 Likes

Hello @ChineS ,

If I got you right you can use Reference Column Filter node to leave only columns which headers are also in first table and then use Column List Loop Start node to iterate over each column. Make sure to use Loop End (Column Append) node in case you want to append column in final table.

Br,
Ivan

3 Likes

Thanks! This is already a very important point I will use more often :slight_smile:

Thanks, this solved the problem even without variables :slight_smile:

1 Like

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