Variables instead of table columns

Hi everyone!

I would like to use flow variables in my nodes (e.g. Math formula), instead of entering fixed column names ($column$). This way the whole worksheet can be updated automatically to perform analysis for flexible columns (in my case months). I would enter it logically like this: $$${variable}$$$

However it is not processed…

Appreciating your help very much!

Tobias

Hello tpahlen,

if you use a Column Expression node it works!
The thing you said is useful, but i don’t know why it is not working.

Cheers,
RB

1 Like

Thanks a lot, lelloba! Yes, it is working in Column Expressions, at least… However I need to use also Column Filter with Variables instead of Colums. How can I select more than one column through different variables?

You are welcome :slight_smile:

If the names are similar, maybe you can use regex inside the column filter node. You can also select/exclude by type (integer, string, etc).
An alternative could be using a reference column filter, so you can input the names of the columns you want to keep.

RB

In addition to @lelloba, be careful if you go the flow variable route: to pass (multiple) columns this needs be in the string list format. You are currently passing it as a regular string. The Flow Variables section indicates which data type it expects.

image

I have created this small test set-up that can be a way to approach this. It:

  • Extracts all the headers.
  • Applies a filter to keep the desired headers.
  • Makes a list out of those and converts it to a variable.
  • Passes it to the column filter.

See WF: Variables instead of table columns.knwf (31.2 KB)

3 Likes

Thank you very much for this effort, it absolutely works this way… Blessings

1 Like

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