Calling all Racers for the Alteryx Grand Prix! It's time to rev your engines and race to the stage at Inspire! Sign up here.

Alteryx Designer Discussions

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

load multiple excel files from a folder

6 - Meteoroid



I am trying to build a macro to load multiple excel files from a folder. It would be great if there is a sample workflow and apps in the designer, to simulate the data.



6 - Meteoroid

Thanks for much for sharing this solution. I need to know one additional thing. How do I add the file's name while importing the data in this case?


I have multiple excel files in the same folder. Each file has 2 sheets each with the same name & structure. I am using the formula tool as you suggested entering the sheet's name. I want to include the file's name as well in the collated data so I can track what data came from which file. Please help.

12 - Quasar

There is a "Include filename as field" checkbox in the input data tool with two options


1) include full path

2) include file name only


This will create a new field in your data that provides the filename of the source file. This works across both batch macros and if you use the input tool with a wildcard.

8 - Asteroid

Hi @kcgreen 


Do you know some macro, which will read all excels and csv files? this one reads only excels

8 - Asteroid

Hi @Andrzej 

For multiple CSV files, I typically use an asterisk or two as wildcards in the file name of a file name.


For example, configuring an Input Data tool to connect to:




will return all CSV files in my Documents folder with "Matched" in the file name


I think this may only work if the files are formatted the same.

This thread may be of use to you:

8 - Asteroid

Any way to do this when the tab names are slightly different per file? Schema would be the same file over file...thinking this can be a macro but would rather not use if possible. 

12 - Quasar

If the sheet names are different across the excel files, then the most foolproof method is to take advantage of the "read a list of sheet names" option within an input tool.


Use either a wildcard or the directory tool to ensure that you get every file in the folder, and when prompted, choose the sheet name option on the input tool. Also ensure that you have the "Output File Name as Field" option set to 'Full path'.


After the input tool, the easiest route is a formula using the replace function to swap out the query string for the sheet name with something like:

Replace([FileName],"<List of Sheet Names>",[Sheet Names])


At that point you should be able to push to a dynamic input tool and not need a macro.


If you need a workflow mocked up just say so. Good luck!


Doing it this way ensures that if a sheet name changes you will be able to adapt.

8 - Asteroid

so i was able to get it to work with a directory and the dynamic input with list of sheet names and change entire file path...I would be interested in how you workflow works though...

12 - Quasar

not sure what you're asking?


In my scenario I have a number of files that have a differing number of sheets within them, each appended with a number ("Page_1","Page_2", etc). However, the data on each sheet is the same schema. It's split due to row limits on excel files.


I use the method outlined in order to ensure we get every sheet for each file, and then union the entire dataset. 


How else can I help?

5 - Atom

@neilgallen thank you for posting. I have a related question on loading multiple excel files. I am trying to complete the Weekly Challenge #19 ( but am having trouble connecting the input tool to the file path that contains the multiple excel files I am trying to read in. I am following the guidelines of using the file path and replacing the common naming of the excel files with the wild card "*". However, I keep running into a couple error messages "Root element is missing" and a "Windows Error: Access is denied". Have you ever run into these errors before?








8 - Asteroid

after this how we could use and read the files columns further. Could you please explain