How to upload multiple files and sheets to Alteryx

by Viktoriia Slaikovskaia

Input in Alteryx is the first tool you will learn and need to start working with data. It's easy to use by Drag & Drop to your Workflow or choosing File Connection in Input Configuration. But what if we need more than one file, sheet or even several files with few sheets inside?

It's okay to choose Input Data Tool 2-3-5 times, but it becomes difficult and time-consuming to use the tool several times.

In this post, I will show:

I. How to upload multiple files to Alteryx

II. How to upload multiple sheets from one Excel file


I. Upload multiple files to Alteryx

This purpose is good to use the 'Wildcard' method.

For using this method, files have to fill into this description:

  • Files should be located in one directory
  • Files should have a common name field
  • Excel files should contain one sheet with the same name
  • Data structures in files should be the same. Same columns name and column numbers through files.

For example, we have Sales Data Directory. Inside it, text CSV files with the common field 'Sales Area 1' in the file names below.

Step 1. Upload one of the files to Alteryx

Drag and drop field to Workflow / Drop Input Data Tool to Workflow, select the file in Data Connection.

Step 2. Change Data Connections field with the 'Wildcard.'

The wildcard is the symbol used for replacing different parts of a file name in the connection path.

  • * - star symbol is a wildcard replacing any number of symbols.
  • ? - question mark symbol is a wildcard replacing only one symbol.

In our case, we have 5 files with a common field we want to connect using wildcard.

We can do it in 2 ways:

With the '?' symbol, we have to be careful.

If we only use one '?' symbol in the second position, we will lose file '10_Sales Area 1'.

Step 3. Run Workflow and check the result

After running the Workflow, we'll have the messages showing which files we uploaded.


II. Upload several sheets from one Excel file

For using this method, files have to fill into this description:

  • Data structures in sheets should be the same. Common column names and column numbers through the file.

For this method, I have an Excel file with 2 sheets.

If we try to upload a file as usual, Alteryx ask us to choose a sheet.

Step 1. Upload list of sheet names

If you forget to choose the correct Excel input, you can change it in the configuration panel Option #3 'Table or Query'

Step 2. Change Input configuration

We need the file name field in our table for future steps. Option #5 need to be 'Full path.'

Step 3. Use the function to change the file name

In the column FileName after '|||' symbols following <List of Sheet Names>. We are going to change it to sheet names we have.

After running WorkFlow, we have the full file name with all sheet names.

Step 4. Use Dynamic Input to upload all sheets

In Dynamic Input, choose any sheet within the Excel file you working with. Important to choose the field 'Sheet Names.'

Step 5. Run WorkFlow and check the result

As you can see, we uploaded 315 records both from Female and Male sheets.

This is how the final Workflow looks like in Alteryx:

Now you are all set and know-how to upload multiple files and Excel sheets to Alteryx.


Cover photo by Omid Kashmari on Unsplash

Avatar

Viktoriia Slaikovskaia