Alteryx designer Discussions

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

Macro to read in 181 files

Highlighted

I have 181 files that need to be merged into 1. what is the best macro approach for this?

Highlighted
Alteryx
Alteryx

You can leverage a Directory tool and a dynamic input, or you can build a macro that feeds each file in and unions them.

 

Although they are not officially supported tools, the CREW macro Wildcard XLSX Input does what you are referring to and can handle different schemas. 

http://www.chaosreignswithin.com/p/macros.html 

 

"These macros are not an official Alteryx release and as such they have not been through the full testing process that tools in the product have.  Some of them are prototypes and experimental, but that is some of what makes them so fun. "

Highlighted
Magnetar

I want to add one more option here, which is that if your 181 files have the same format and are in the same folder, you can include a wildcard character in an Input Data tool.


For example, if you had a folder named "Yourfolder" on the C:\ drive, and wanted to load Sheet 1 of all Excel files in this folder, you could configure your input data tool as follows:

C:\Yourfolder\*.xlsx|||Sheet1

C:\Yourfolder\ tells Alteryx what folder to look for.


*.xlsx tells Alteryx to look for ANY excel file in that folder.  You can make this more specific by adding other characters, for example if all of the files you wanted start with the year (2019), you could use:

C:\Yourfolder\2019*.xlsx|||Sheet1

|||Sheet1 specifies that we are always looking for the first sheet in Alteryx.


hope this helps!

Labels