Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Same workflow, different input files

Isaac_Juarez
7 - Meteor

Hello,

 

I was wonder if somebody can give me guidance about this use case.

 

I have 12 different files, every file represents Cavity 1, Part1 and so on. the file is a dimensional report so it is going to have different measurements.  

 

example: 

 

Dimensions 161A  will have 12 measurements (Actual column).

 

my questions are  Can I run the same workflow for the 12 different files?  and Can I get the average from the actual columns? 

5 REPLIES 5
Luke_C
17 - Castor
17 - Castor

Hi @Isaac_Juarez 

 

Yes, depending on if the files need to be processed separately or combined and then processed there are a few options using either wildcard inputs or a batch macro. If you export the workflow as a yxzp or send some sample excel files someone can help mock that up for you. There are also a number of resources in the academy for macros as well. 

Isaac_Juarez
7 - Meteor

Hi Luke;

 

combine them or not only depends on the way to get the average out of the measurements... attached the file

Luke_C
17 - Castor
17 - Castor

Got it, heres a basic example of a batch macro to read in the files. I think this should get you on the right path, but let me know if I misunderstood.

 

 

This will apply the same common steps to each file, then append the data into one big table. It does assume the tab name is the same for each file. I enabled the option to put the filename as a field so you can differentiate down the line.

Luke_C_0-1619803690267.png

 

The workflow itself just requires you to update the directory tool to where the files are saved. The fullpath is then passed into the macro and each file is processed before being output for further analysis.

 

Luke_C_1-1619803735820.png

 

 

 

 

Isaac_Juarez
7 - Meteor

OK, but it is the same issue that I am trying to solve... is there a way to run the same macro for all the 12 files at once instead of having 1 macro per file? 

Luke_C
17 - Castor
17 - Castor

Hi @Isaac_Juarez 

 

Yes, that is the point of using a batch macro. By using the directory tool, you are pointing alteryx to the folder that has your files. The macro then takes each file in that folder, processes, and outputs it to your dataset. There is not one macro per file.

 

Macros can be a bit tricky to understand, I highly recommend checking out the lessons, they're usually pretty short:

https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Macros

 

Labels
Top Solution Authors