Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Batch Macro - Need Some Help

JohnMaty
9 - Comet

Hi All,

I have a sample batch macro attached.  Obviously I do not know what I am doing.  Basically I am trying to take 50 different tables from one database and import them into a different database. The query is simple but the tables are all of different structure.

 

Select * from TABLE where lastupdatedt >=dateadd(day,-5,Getdate())

 

I have attached an example.

 

I basically have two questions:

 

1. How do I finish this macro? How do I tell it to update my local tables?

 

I am getting a error saying

 

Warning: Dynamic Input (5): The file "" has a different number of fields than the 1st file in the set and will be skipped

2. What does this mean?

 

4 REPLIES 4
LordNeilLord
15 - Aurora

Hey @JohnMaty

 

A batch macro works through a list of things one at a time, for example in your case you may feed it a list of table that you want to query. It will finish when there are no more things in the list.

 

You are using the dynamic input tool here (not a batch macro)...it is complaining because the default behaviour of Dynamic Input is to union all of the outputs together....but if the outputs of the tables do not have the same schema it will not work.

 

So what you really need is a dynamic input tool and an output tool within a batch macro.....this will run your query and output each tables results into a separate output files

JohnMaty
9 - Comet

Thanks for the info. 

I do not know how to do that.

Additionally do you mean that the dynamic input AND output tool need to both be in the (same) batch macro?

 

LordNeilLord
15 - Aurora

Hey @JohnMaty

 

So your batch will look something like this:

 

Batch.PNG

 

How to use...in the batch macro attached...set the output name for the file...Save it

 

Drop this macro onto a new canvas and then plug in your text input...this is now a batch macro.

 

There are some really good videos on youtube for creating batch macros...have a look at some

JohnMaty
9 - Comet

I will take a look  Thanks a bunch!

 

Labels