Alteryx Designer Desktop Discussions

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

Adding Multiple .csv files to a workflow

dlayne
5 - Atom

Good day,

 

I have a monthly report that requires me to take weekly data, which has columns containing staff names, and the dates in the month.

How can I add them from a directory into my workflow. I added them individually however would prefer an alternative. 

Files are in .CSV 

 

Appreciate any assistance.

dlayne_3-1607103232079.png

 

 

 

 

 

7 REPLIES 7
Emil_Kos
17 - Castor
17 - Castor

Hi,

 

Please check this post. It will guide you how to achieve your goal:

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Importing-multiple-excel-files/m-p/344...

 

Good Luck!

leon2020
7 - Meteor

Use only one input data tool, and replace the filename part with the wildcard * (eg. C:\Users\directorypath\*.csv)

 

It will pull all the csv files in the directory, and union them all together.

 

dlayne
5 - Atom

Attempted it and used a marco however information, its coming out like below which causing issues further down.

 

dlayne_0-1607354499352.png

 

The below shows how i have it using my original method.

dlayne_1-1607354545482.png

 

dlayne_2-1607354642887.png

 

 

dlayne
5 - Atom

Hey, no it didn't work, it unions them as you said but different schemas.

leon2020
7 - Meteor

You were using an union in your screenshot to join the files?

 

You can change the configuration of the union to configure by position rather than name - would that help?

 

Or, you can accept it loads as it is (the data is now all in your workflow, so that's a good first step!) but use a series of subsequent tools to pick out and align the columns (eg Field info, dynamic rename, and later union).

 

 

dlayne
5 - Atom

When i try that they end us stacking up, and lose the column names which are dates. Trying to add other tools to adjust it.  

leon2020
7 - Meteor

When you import the file using the import tool, there is an option within the configuration to include as a field the filename.  It looks like your filename contains the date, so with the filename in the workflow you can use a formula tool to extract the date.  I would be tempted to uncheck the "First row contains field names" and input the data as generic column titles.  Once the data is in, you might consider Transform tool Transpose and perform some calculation (based on the filename date) on what the column headings should be, before crosstabing it back.  Or perhaps a series of Field Info and Dynamic Renames...   hope that gives you some ideas?

 

leon2020_0-1607355912769.png

 

 

 

Labels