Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

Batch Macro - run a batch macro 100 times

Highlighted
6 - Meteoroid

I need a workflow to merge 1000s of CSV files from 100 db tables into 100 files.

The files have been named as "TableName [SPACE] FILENUMBER" (Table1 01, Table1 02... Table3 04)

 

I have written a simple batch macro that unions CSV files. (Unioniser.yxmc)

 

I need to write another batch macro that can run the  Unioniser macro 100 times  and output 100 CSVs, 1 for each table.

 

My macros this far

Unioniser  

 

Unioniser.png

For the second macro that can run the above once for each Table, I can generate a listing of table names and filepaths using the directory and formula tools and further get a unique list of table names using the Unique tools as below.

 

1st  Unique tool - FilePath & FileName and Table Name

2nd Unique tool (Upper) - Table Name Alone 

 

Capture.PNG

 

How do I proceed further with calling the Unioniser macro one for each TableName ?

Highlighted
Alteryx Partner
Alteryx Partner

If you wrap what you have built into another batch macro with a list of 100 rows (could be really anything). You could also do a iterative macro (while value < 100) but not as straightforward in my point of view. Let me know if you'd like an example. 

 

Hope this helps!

Joshua

Highlighted
6 - Meteoroid

Thanks Joshua..

Not using text input I would like the workflow to have no manual input.

All the files to be merged are in a single directory and the directory tool provides the required inputs - file names and file paths. The files are to be consolidated based on filenames. Hence the inputs are dynamically calculated from a single directory reference. An example would be great. Thank you very much.

 

 

Labels