is there a Knime-Way to create a list of all entries of a column? I know there is a “list” option in GroupBy Nodes but I do not know how to convert this list to string type.
So far I use a Python-Script Node with:
import pandas as pd
a = ".*|".join(input_table_1["Column0"])
data = {"Column0": [a]}
output_table_1 = pd.DataFrame(data)
Background of my question:
I convert this string-list to a variable and use it later as a parameterized sql query.
Andreas
PS: There is a Vernalis Node “list to string variable”. But I’m not allowed to use one of these.
You can set the delimiter that you want, in this case I set it to “|”.
Results:
The other one that I want to show you is useful to convert list to string, like you tried to do, so basically if you already have a list. Let’s say you have this list:
(It’s actually [aa,bb,cc,dd,ee,ff])
You can use the joinSep() function to “convert” the list to string. The joinSep() function will take each item of the list and join them with a separator (“joinSep” where “Sep” means separator, can be read as “join with separator”).
The expression would be: joinSep("|", $column1$)