Alteryx Designer Desktop Discussions

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

Pull list of sql queries to run

amrm1619
5 - Atom

I'm just starting to look at Alteryx and was not finding much yet, but my question is can Alteryx pull from a location a list of sql queries and execute to compile the results into single dataset?

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hi @amrm1619 

 

Is the dataset located in a file or in a database?

 

If it's in a database, you can use the Dynamic Input In-DB Tool to pass a SQL query and a Connection String and execute the statement against a specific database.

 

Cheers,

Tanai_Goncalves
8 - Asteroid

Hello @amrm1619 

 

This is totally possible with a batch macro.

 

Please find attached an workflow with the following suggestion:

 

Read the directory where the queries are located as .txt, then read all of them with dynamic input, after that send the query code to the batch macro, and it will replace for the statement of desired query.

 

Workflow:

 

Tanai_Goncalves_1-1649446758685.png

 

 

Macro:

 

Tanai_Goncalves_0-1649446733000.png

 

Tanai_Goncalves_2-1649446865386.png

 

Remember that the batch macro will run 1 time for each row, and each row is a query.

 

You will need to update your credentials on Database.

 

Hope this helps, 

 

Tanai

amrm1619
5 - Atom

I have been trying to get this to work, but I don't see a macro control in my Alteryx just a control parameter.  Am I missing something?

Tanai_Goncalves
8 - Asteroid

Hello @amrm1619 

 

you don’t need the control parameter in this case as the batch macro will run for each row on your input.

 

The control there are the number of rows entering the macro.

Labels