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!
Hi @amueller2 thanks for your response. can you please explain it a bit or share the solution with us.
thank you!
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.
User | Count |
---|---|
19 | |
15 | |
15 | |
9 | |
8 |