Alteryx Designer Desktop Discussions

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

Loop Over Files

vosorio3
5 - Atom

Hello, 

I'd like to execute following base program over multiple files: 

vosorio3_0-1636565753395.png

Where the input file contains the following: 

vosorio3_1-1636565789147.png

And the output contains the following: 

vosorio3_2-1636565855495.png

The workflow above works fine with one input file. 

 

I'm attempting to use a macro to iterate over 2 more files (numbers_two.xlsx, numbers_three.xlsx). The goal is to iterate over each file one by one, and output separate output files, one by one. 

 

The action tool is set to the "first" file to iterate over 

 

How do I "tell" the workflow to go to the "next" file? Moreover, where do I tell it what the next file is? How can I provide it a list of files, etc.? 

 

vosorio3_3-1636566143061.pngvosorio3_4-1636566246626.png

 

 

3 REPLIES 3
HomesickSurfer
12 - Quasar

Hi @vosorio3 

 

Here's my efficient, effective and macro-free solution:

Workflow and sample input files attached.

Place in:  C:\temp\Loop Over Files - vosorio3\ to test

 

Capture.PNG

vosorio3
5 - Atom

Thank you so much for your time and response.

 

Checking with the Powers That Be if this is viable - they seem to be adamant about keeping all the file information silo'd + independent (don't union em, a "true loop" if you will), but the Alteryx community seems to agree that macros are a pain. 

 

I'm testing your files now!

HomesickSurfer
12 - Quasar

Hi @vosorio3 

 

You can offer assurance that the inputs' filenames carried downstream and the use of the FileGetDir([FileName])+FileGetFileName([FileName])+"_out"+".xlsx"+"|||Sheet1" keeps the records strictly tight and output appropriately.

You could incorporate a succession of RecordIDs and Test tool expressions, etc...but not required.

Labels