Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Join multiple CSV files in a folder

Saravanakumar
メテオール

I have over 30 individual files. Each file has different fields except the column "Key".  How can I join all the files easily.

 

I also need only some of the fields from each file, I have the list of fields needed.

 

I tried *.csv in the input tool and Dynamic input they try to union the files but not join by "Key" column.

 

Could anyone advise please?

6件の返信6
ChrisTX
16 - Nebula
16 - Nebula

With each file having a different layout (schema), you'll likely need a batch macro.

 

Check out this knowledge base article.

 

The Ultimate Input Data Flowchart
Community > Designer > Designer Knowledge > The Ultimate Input Data Flowchart
https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/The-Ultimate-Input-Data-Flowchart/t...

 

Chris

Qiu
21 - Polaris
21 - Polaris

@Saravanakumar 
I always use this macro to read multiple files/Worksheets and it works fine.

 

CoG
マグネター

Not sure if other workflows do the joining you mentioned, but this one does! Just make sure that the key column is labeled properly in the Dynamic Input Tool, by associating template file (unless the name is Key). Also, all desired columns must be included in the Column Names input.

Main Workflow:

Screenshot 1.png

Macro 1 (Standard):

Screenshot 2.png

Macro 2 (Batch):

Screenshot 3.png

rohit782192
ボリード

Batch Macro is the Only Solution

SrikanthSoma
アトム

Thanks Chris. Very helpful.

omkarshinde
アステロイド

@Qiu any way to add filename as extra column with every record while reading multiple files via this batch macro?

ラベル
トップのソリューション投稿者