Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hello everyone,
I need your help in using a list as project variable in a SQL query.
I have a dataset with a list on numbers, with a custom python recipe, I stored the numbers as list in my variable project. It's looking like this :
{
"liste": [
12265378,
9122915,
12292085,
12514810001,
12241211,
12262172,
4624440]
}
I now would like to use this list in my SQL recipe in my where condition as :
SELECT *
FROM TABLE
WHERE NUMBERS IN ('${liste}')
But it seems Dataiku is reading it as a long string.
If anyone could help please (it will help me a lot for this project and a lot of others).
Thanks!
Operating system used: Windows
There is a related thread here: https://community.dataiku.com/t5/Using-Dataiku/Reuse-Dataiku-variables-list-in-SQL/td-p/3247.
You can also create your variable looking like this "liste": "(12265378,
9122915, 12292085, 12514810001, 12241211, 12262172, 4624440)". Instead of using the square brackets, use the curve brackets, so they appear as a string and your sql query will look like this SELECT *FROM "TABLE" WHERE "NUMBERS" IN ${liste}