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

Alteryx Designer Cloud Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Cloud.

Batch Macro to execute multiple SQL queries

HarrisCollins
5 - Atom

We have a single database that we want to run tests against. Some of these are as simple as ensuring that the periods are Jan-Dec. Some are as complex as ensuring that the dollars per transaction are reasonable. We would like to run these multiple tests as SQL (e.g. SELECT COUNT(*) FROM [table] WHERE PERIOD IN ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')). 

 

 

We are looking for a batch macro that will run the various SQL's against a single database and then output the results of each SQL query to a single output table.  

 

Any assistance we can get with the building of this batch macro will be greatly appreciated. If more information is required, please ask. 

2 REPLIES 2
HarrisCollins
5 - Atom

Do you know how to resolve this using Alteryx. Our hope is to add this batchmacro to an alteryx work flow. 

apathetichell
19 - Altair

 @HarrisCollins - Hey - sorry - didn't see this - probably should be in Designer Desktop vs Cloud - but you can do what you are trying to do via a batch macro. You can either have the control parameter change values directly in your query (in Connect In-DB or Dynamic Input) or you can go via text input tool/Dynamic Input-In-DB etc... So there are a slew of different ways you can do this depending upon how much data you are using and whether you want to process In-DB or on canvas. If it's just on canvas you should use a query in Input Data and have your action tool modify whatever values you want in your query there.