ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
The Alteryx Community will be temporarily unavailable for a time due to scheduled maintenance on Thursday, April 22nd. Please plan accordingly.

Alteryx Designer Discussions

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

Importing Multiple Excel Files with same header and adding in a Filename Field.

jdelaguila
8 - Asteroid

Alteryx Community, 

 

I'm trying to import Multiple Excel Files (.xlsx) from the same folder with the same headers.

 

However I'm encountering an error every time I run my workflow: "filename has a different schema than the 1st file in the set and will be skipped". 

 

I attached my workflow along with the 3 files i'm trying to import in. I thought it would be simple enough using a wild card * to bring in all the files but apparently it is not. Read a bunch of articles about using Macros but I haven't dug deep into building Macros yet or how to use them. 

 

The goal here is to setup a workflow that will import all files located in a folder (regardless weather its 1 file or 10 files), combine them (shouldn't be an issue as they all have same headers) and than create a field that tells me what file they came from. 

 

Appreciate any help here and thank you!

Javier

 

aruiz-itp
11 - Bolide

Hi @jdelaguila 

 

Here is an example with a batch macro 

 

Just located the directory to your file, modified the formula with the name of the sheets 

 

let me know if you have questions

jdelaguila
8 - Asteroid

jdelaguila_0-1612986243176.png

 I'm new to building macros unfortunately. Can you shed light on what i would need to update here? 

 

I did create a folder, dropped the macro you specified - but not sure how to point to the macro. 

aruiz-itp
11 - Bolide

Did you instal the yxzp? Because this install everything without problem

 

You can give right click over the canvas go to macros and open the folder where the macro is  

cgoodman3
12 - Quasar
12 - Quasar

If you have installed from the yxzp file, it’s is likely that you are running a prior version of Alteryx compared to the version that @aruiz-itp built. If you separately open the yxmc (macro file) in designer, save it and then reopen the yxmd file it should work.

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
jdelaguila
8 - Asteroid

Yep i was running an older version of Alteryx. After the update it fixed the import issue. The import worked nicely and brought in all the records from the multiples file i had.  Last question is - I want to add a field to this workflow that tells me what file the data is coming from. What's the best way to do that?

 

Thanks again for all the help!

 

Javier

aruiz-itp
11 - Bolide

yes open the macro and just select this option in the input tool

 

aruiz-itp_0-1612998702022.png

 

then saved the macro and close it.

 

Execute again the workflow and there will be the field

 

 

Labels