Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to use IN clause in alteryx

tanvir_khan
8 - Asteroid

Hi

is it possible to implement SQL IN clause using alteryx tool(s)?

for example,

select * from table1

where ID IN

('10','20','30') 

if the number of values are less we can directly put those within the query of Input data node as above. But it's not feasible if there is couple of thousand records. Is there any alternate way to do this in alteryx? 

thanks! 

11 REPLIES 11
tanvir_khan
8 - Asteroid

Hi @amueller2 thanks for your response. can you please explain it a bit or share the solution with us.

 

thank you!

amueller2
5 - Atom

You could use a SQL statement like this:

 

 

SELECT *
FROM table1
WHERE table1.ID = '%ID%'

 

 

 In a Dynamic Input tool, and then use the setting "Modify SQL Query" with "Replace a Specific String" to replace the string '%ID%' with the contents of another text input or other input tool that has the IDs. See the attachment. I am unable to provide a version with a functioning SQL table, but if one had a table with data such as

ID Data
10 Jeffery French
20 Amara Bond
30 Rowan Wade
40 Matias Harrington
50 Dennis Long
60 Bradley Thompson
70 Zayden Watkins

and used that SQL query with the dynamic input set up as in the attachment, it would output the three records with the relevant IDs.

Labels
Top Solution Authors