community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Read Multiple files in Alteryx and Union multiple files data

Highlighted
Meteor

Hi,

 

I am having below files paths in  column "Full Path

 

Full Path 
C:\Users\Output\ABC.xlsx
C:\Users\Output\DEF.xlsx
C:\Users\Output\ABC.xlsx
C:\Users\Output\ABC.xlsx

 

Presently I am having 4 file paths but the file paths may increase.

 

I want to read all these files and simultaneously union the data of all these files. 

 

 

Many Thanks!

Quasar
Quasar

hi @SejalP1,

 

if all the files have the same schema (exactly the same columns, data types...) you can use a wildcar like C:\Users\Output\*.xlsx.

The other way would be to use a directory tool to scan the directory, followed by a batch macro to read all the files. 

 

(see thois link for info on the batch macro https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/CS-Macro-Dev-Reading-in-Multiple-Fi...)

Alteryx
Alteryx

You could also try s@CameronSteele's macro to Read All Excel Files/Worksheets Macro! It basically wraps a bunch of the functionality that you would need to build in your batch macro into a single, awesome tool! Here is the Community Post: The Ultimate Alteryx Holiday gift of 2015: Read All Excel Worksheets Macro and here is the link to download the macro from the Gallery.

 

Cady

Meteor

Thanks for Your Reply,

 

Suppose I am having different  Directory and File paths.

Directory A and B is having different sub folders as "01" and "02"

 

directoryFile Path 
C:\Users\AC:\Users\A\01\ABC.xlsx
C:\Users\AC:\Users\A\02\DEF.xlsx
C:\Users\BC:\Users\B\01\PQR.xlsx
C:\Users\BC:\Users\B\02\LMN.xlsx

 

I would like to Union directory "A" output separately(i.e union File ABC and DEF) and

directory "B" output separately (i.e file PQR and LMN).

 

Note: Column name schemas are different for Directory A and Directory B but file format is same i.e .xlsx 

 

Thank You

Alteryx
Alteryx

Then you would need to use 2 Input tools with the wildcard method that @Ladarthur mentioned, one pointing to each folder. There are a couple of ways to accomplish this, but if the schema's are indeed the exact same I think that would be the easiest. 

 

Other methods:

- use the directory tool and search sub-directories, apply to filter to split to two data streams on directory A and B, then use dynamic input configured to update Full Path to Union files together.

- Use two Excel File Openers pointing one to each directory

 

Cady 

Labels