Alteryx Designer Desktop Discussions

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

loop through multiple xlxs files

jogayon001
7 - Meteor

Hi All, 

 

Im trying to create a workflow wherein all files in my 1st input data tool will run in the attached workflow; next it has to create a file for each output file. 

 

Appreciate the help 

6 REPLIES 6
fmvizcaino
17 - Castor
17 - Castor

Hi @jogayon001 ,

 

The first thing you need to do is to configure your input data tool as image below. Using that configuration, you bring as a column the name of each file loaded.

fmvizcaino_1-1580361006349.png

 

After that, you need to carry that column until your output data tool where you configure as image below. The idea is for you to create a different file for each [FileName] you have in your dataset. So instead of [Registration name], you need to use the filename for each file.

fmvizcaino_2-1580361067108.png

 

Let me know how that goes.

Best,

Fernando Vizcaino

 

jogayon001
7 - Meteor

Thanks fmvizcaino, that was useful. 

 

Also, my challenge is to put all of these files in a loop. What could be the best approach?

fmvizcaino
17 - Castor
17 - Castor

Hi @jogayon001 ,

 

If you need to execute your workflow one file by one where you generates and output each way your workflow runs, the best approach is to use a batch macro.

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Getting-Started-with-Batch-Macros/t...

 

The idea is for you to have a workflow where you get all the files names and you insert in your batch macro (your workflow which some tweaking) which will run for each filename you insert. I'm attaching an example to show you how.

 

Best,

Fernando Vizcaino

jogayon001
7 - Meteor

I was able to recreate the workflow however im getting this error. 

 

jogayon001_0-1580373644898.png

 

What do you think is the problem?

 

Thanks!

fmvizcaino
17 - Castor
17 - Castor

Hi @jogayon001 ,

 

I wasn't able to find your yxzp file in the thread, so I have adapted my example to your needs. In your case, since you want to generate one file per batch macro run, you can insert the output data tool inside your macro and to reconfigure the input data tool and output data tool as images inside the macro.

Take a look.

 

You need to insert the filename in the inputdata tool marked as 'full path' and insert the same column in your output data tool.

 

Best,

Fernando Vizcaino

jogayon001
7 - Meteor

Hi 

 

Thank you for the response. I tried to follow your instructions but I keep getting this error. 

 

 

jogayon001_0-1580547935091.png

 

jogayon001_1-1580548140133.png

 

Thank you for your patience. 

 

Labels