Submit your innovative use case or inspiring success story to the 2023 Dataiku Frontrunner Awards! LET'S GO

Use a list as variable in SQL Query

Sv3n-Sk4
Level 3
Use a list as variable in SQL Query

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

0 Replies

Labels

?
Labels (1)

Setup info

?
A banner prompting to get Dataiku