inputting multiple files at once with a single tool in alteryx

Do you need to input multiple similarly structured files into an Alteryx workflow? Does it seem crazy to put a bunch of input tools into the same workflow to load identically formatted files? Alteryx thought so, and they have a solution. Alteryx allows you to use a single input tool to load multiple files at once, as long as they have the same data structure.

In my experience, loading multiple files of the same format is a common Alteryx use case because many companies store various data sets/reports in shared storage locations over specific intervals of time (daily, weekly, monthly, quarterly, etc). The need to analyze all of this data at once occurs regularly and can be handled with ease using Alteryx. A frequent example of this is storing monthly sales reports on a shared drive.

Below I have outlined the two most common ways to accomplish this task.

Option 1 – Use a wildcard to input multiple files at once in Alteryx

The first way to accomplish this task is by utilizing a “wildcard” in your input tool configuration. To do so,  you need to configure your input tool as if you were inputting a single file, but then you replace part or all of the filename with an asterisk (*). The asterisk works as a wildcard, meaning that it matches any set of characters. When using this functionality, the input tool pulls all the files in the specified folder location that meet the wildcard criteria and unions them into a single data set. To further illustrate how it works, the screenshot below will be used as an example:

Example Wildcard (*) Functionality:

  • C:\Users\Alteryx\Example\*.csv = Alteryx would input all of the “.csv” files in the folder location
  • C:\Users\Alteryx\Example\*2019-10-21.csv = Alteryx would input all of the files that end in “2019-10-21.csv”
  • C:\Users\Alteryx\Example\sales*.csv = Alteryx would input the two files that start with “sales” and end with “.csv” above.

Note: All of the files selected by the wildcard input must have matching file structures, otherwise some of the files may be selected by the input tool but will not actually load into Alteryx. Below is an example warning message you will receive when this occurs:

The file “C:\Users\Alteryx\Example\receiving2019-10-21.csv” has a different number of fields than the 1st file in the set and will be skipped

In the bullets above, only the third bullet would work as expected because it is the only data set that contains the same data structure across all files that were selected by the wildcard input.

Option 2 – Use a directory tool paired with a dynamic input tool to input multiple files at once in Alteryx

Another way to pull multiple files into your Alteryx workflow without inserting an input tool for each file is by utilizing a directory tool paired with a dynamic input tool. A directory tool’s configuration prompts you to specify a folder location, and when run in Alteryx, provides a database containing details on all the files in that folder. On the other hand, a dynamic input tool allows you to dynamically pull files based on data in your Alteryx workflow. These two tools work together perfectly because you can use the directory tool to find files you want to input into your workflow, and then you can use the dynamic input tool to actually input those files.

Example Alteryx workflow to input multiple files at once in Alteryx

You can find an example of both options in action here: Multiple Input Files Alteryx Workflow

FAQ: Is there a way to fix the problem where some of my files have a different number of fields?

If you want to input very similar files but the schemas are slightly different, you can learn how to do that here. If the word “here” is not yet hyperlinked, that means I haven’t wrote the post yet 🙂

FAQ: This doesn’t seem to work when I try to do this with excel files. How do I do this with .xlsx files?

If you are having issues dynamically inputting excel files (.xlsx), click here to learn how to solve that issue. If the word “here” is not yet hyperlinked, that means I haven’t wrote the post yet 🙂

If you have any questions or take a different approach to inputting multiple files, let us know in the comments below!

 

Was this article helpful?

Was this article helpful?

Was this article helpful? *