Alteryx Designer Desktop Discussions

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

Pass SQL results from one input tool to the SQL statement of another input tool

flipperdm
8 - Asteroid

Hi, 

I've looked through the Knowledge base and found dynamic input or reading from a saved file but couldn't find an answer to this issue.

 

Basically, I have a really large database that needs to be filtered by order numbers inputted from from another smaller database. How can I run the smaller database (Input Tool) and feed those results into the "where" portion of the SQL statement in the larger database (Input Tool #2) (eg. where order_number in (xxxx, xxx, xxxx, xxxx)).

 

Thanks,

Mark
 2017-09-20 20_20_21-Sent from Snipping Tool - Message (HTML).jpg

3 REPLIES 3
NicoleJohnson
ACE Emeritus
ACE Emeritus

You actually should be able to do this with just two tools - an initial input & a Dynamic Input. Some basic instructions below:

 

DynamicInput.JPG

Essentially, your initial query is giving you the list of order numbers, and the second query can then take that list and replace an initial Where clause (that might just contain one order number for simplicity) with the list of order numbers from the original input. The Dynamic Input tool is one of my favorites for this reason - it is so often quite powerful when it comes to creating queries that pull from multiple worksheets, or from a new file each day, or a dynamic range of data, etc.

 

I hope this helps!

 

Cheers,

NJ

Voska
8 - Asteroid

I'm curious.. when you do this is it executing the dynamic query once for each row in the first input?

flipperdm
8 - Asteroid

Thank you, I'll test this out this week

Labels