community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Batch Macro - run a batch macro 100 times

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 ?

Alteryx Certified 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
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