Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Running Workflow on Multiple Excel Files in a Folder

Lion24
7 - Meteor

Hello,

 

I have written a workflow that takes an excel file and formats the file a certain way. I have 5 excel files (all formatted the same) that I would like to run through the workflow. The ultimate goal is to run the workflow for all 5 files, one at a time, and output them into a single excel file. I have read posts that perhaps a Batch Macro would help with this? I am a bit unsure of how to go about doing this and am looking for some input into the following:

 

1) How can I have my workflow run automatically for all 5 files I have saved in my folder?

2) How can I output them into a singular excel file?

 

Thanks!

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hi @Lion24 

 

A batch macro might work, but could you please explain your process and maybe share a print screen of how the workflow would look like for a single file?

 

Cheers,

Lion24
7 - Meteor

Hi Thableaus,

 

Thanks for the response. I've attached a picture of a similar workflow to mine. It simply imports a single excel file and formats it in a certain way using filters, sorts, parse, etc. 

 

Looking for ways to run this workflow 5 times (one for each file in my folder) and output into a singular excel file (with the data just stacked on top of each other).

 

Thanks,

Thableaus
17 - Castor
17 - Castor

@Lion24 

 

This article might guide you in your task: https://community.alteryx.com/t5/Alteryx-Knowledge-Base/CS-Macro-Dev-Reading-in-Multiple-Files-with-...

 

See if any of these options fit your situation and let us know if there are any questions.

 

Cheers,

estherb47
15 - Aurora
15 - Aurora

Hi @Lion24 

 

Do the files match in schema? Meaning, are the columns in the same order with the same column headings? In that case, you might be able to read in the files first (either using a wildcard in the input tool, or dynamic input), and then do all of the processing. 

 

If the files vary in schema, then take a look at the article posted by @Thableaus . This exact process has worked for me many times over.

 

To briefly explain, a batch macro would read in one line of information, process the macro, then move down to the next line, process the macro, etc. Every output is appended one after the other, until all of the lines are run through. You would be sending each of your five files through the macro, one at a time, and then they'd all be unioned together.

 

Then create your workflow to clean up your data. A single Output Data tool will write everything into one Excel file for you.


Let me know if this helps.

Cheers!

Esther

Labels