technology and project consulting

Topic Thursday:
how to read in multiple data with the same tool

Alteryx tips from our expert Alexander Gross

07/07/2022
M2, Blog, Alteryx

Tenth part of our new series "Topic Thursday" with valuable tips and insights around the topic Alteryx. The articles are written by our colleague Alexander Gross, Alteryx ACE and Business Intelligence Consultant & Alteryx Lead at M2.

Often you face the problem: "How do I input multiple files with the same format so that this still works when new files are added?". This article is about wildcards that allow input multiple files in the same format.

In many cases systems generate the same files on daily, weekly, monthly or yearly level. Processing these in small quantities can be easily done with additional input and union tools – but what if we have one file per month for the last 10 years? How can we import them all at once and build the workflow so that all other files are automatically imported as well? The answer: inputs with wildcards.

What are wildcards?
Wildcards are, in a sense, "placeholders", or dynamic characters. There are exactly two of them in Alteryx. The question mark (?) and the asterisk (*). While the question mark is just a simple placeholder for a single character, the asterisk can be a placeholder for more than one character. The whole thing is best explained with a few examples.

How do wildcards work?
Suppose we have the following folder:

It is important to note that all files have exactly the same structure (same number of columns and same data type in the columns).

Of course it would be possible to input 13 input tools all data, but this would not be dynamic. First we want to read in only the months 01 to 09 to analyze the quarters 1-3.
The file names always have a relative simple scheme (2009-01 to 2009-09). To read in all 9 files at once, we replace the last number with a question mark:

Important: The question mark is a placeholder for any character. If there were files like "2009-0a" in the same folder, these would also be read in.

If we want all data of a year, we can reach them both with a double question mark (??) and with an asterisk (*). With the asterisk, however, we would only search for 2009-*.csv, since this can replace any number of characters.
The asterisk can be used very flexibly and does not always have to be at the end - the same applies to the question mark. For example, if we want to compare January over several years, we can do this as follows:

*-01.csv or ????-01.csv

Of course, the two wildcards can also be combined so that significantly more complex naming schemes can be covered.

 

 

Every second Thursday is Topic Thursday: our colleague Alexander Gross, Business Intelligence Consultant & Alteryx Lead at M2, shares his expert knowledge on workflow building in Alteryx. With his tricks and tips, you can use Alteryx even more efficiently.

 

Do you have any questions about this article or about Alteryx in general? Then please feel free to contact us at any time. We look forward to exchanging ideas with you.

Your M2 team

Phone: +49 (0)30 20 89 87 010

info@remove-this.m2dot.com  ·  M2@Facebook  ·  M2@Twitter  ·  M2@LinkedIn  ·  M2@Instagram