Free Trial

Alteryx Designer Desktop Discussions

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

How to update SQL query with Dynamic values

srk0609
8 - Asteroid

I want to update my SQL Query with values that my other workflow is providing for example if the workflow is giving list of following accounts(1,22,3,45,5) I want my SQL Query to update automatically.

 

Select * from Table_name where Account in(1,22,3,45,5);

 

Can you please help me with it? It would be really helpful if you could explain with a Workflow. Thank you for help

1 REPLY 1
TUSHAR050392
11 - Bolide

Hey @srk0609

I have done this at work. In my case I was saving the output of first workflow in an excel, followed by reading that in the new workflow using dynamic input in case you are producing a new output file daily but if you are appending the first output file, you can just use an input tool. Use a summarize tool to get the data into the form of (1,22,3,45,5). This can be achieved using concatenate function.

 

Once you get the data from your first workflow, you will use one more input tool which will have the SQL code from Select till in. Now append this with above concatenated data and use a formula tool to make your string like Select * from Table_name where Account in(1,22,3,45,5). Once this is achieved, you can use Dynamic input to read your data by defining the connection string as you must be doing already.

 

Hope this helps

Labels
Top Solution Authors