We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Concatenate Multiple Monthly CSVs which sometimes have additional columns

colleenaowens
5 - Atom

I have these monthly statements for multiple clients that I'm trying to concatenate into one table.  I found a macro that will concatenate the statements ONLY if there's the same columns in the same order... but will leave out files if there are extra columns.  

 

For example:

- Company A: 2024-07 has 19 columns

- Company A: 2024-08 has 25 columns (the original 19 plus six extra)

- Company A: 2024-09 has 19 columns

- Company A: 2024-10 has 19 columns

 

Using my current macro (which I downloaded from an Alteryx discussion page but I can't find the original - it was called To_Community_Read_Multiple_CSVs /  Read_All_CSVs.yxmc) , it will concatenate 2024-07, 2024-09, and 2024-10 for Company A, omitting 2024-08 with the following error: Error: Read_All_CSVs (45): Record #2: Tool #4: The field schema for the output "Output18" changed between iterations.

 

Same thing happens for Company B:

- Company B: 2024-08 has 19 columns

- Company B: 2024-09 has 19 columns

- Company B: 2024-10 has 19 columns

- Company B: 2024-11 has 25 columns --- this will end up getting omitted from the concatenated table for Company B.  

 

I've attached sample data in a zip file.   I'm very new to Alteryx and it's unfortunate I'm stuck at the "loading data" phase before I can use any of the other tools I've learned about. 

Ideally I'm trying to end up with a master table that looks like this:

Company

(added column)

disbursement_date (column 1)#_of_transactions (column 2)... ... ... 

chargeback_fees_USD

(column 19)

us_bank_account_gross_#_of_sales

(column 20)

... ... ...

us_bank_account_total_disbursement_USD

(column 25)

A07/31/202420 0null or 0 if possible null or 0 if possible
A08/01/202412 00 0
B08/01/20240 0null or 0 if possible null or 0 if possible
A08/02/202425 04 34.44
B08/02/20240 0null or 0 if possible null or 0 if possible
 etc      
4 REPLIES 4
binuacs
21 - Polaris

@colleenaowens try the attached workflow

image.png

colleenaowens
5 - Atom

I tried downloading your flow and running it but it gives me these errors:

 

2025-04-15_9-36-43.jpg

abacon
12 - Quasar

@colleenaowens Why does the error show the file path as a YXDB?

colleenaowens
5 - Atom

OH!  good catch!  I'm not sure entirely but I'm hypothesizing that the .yxdb files are probably the result of other attempts of concatenating the files.  I'm guessing the macro in the solution proposed doesn't specify that it should only try to pull csv files.  

 

So I modified the Directory tool to File Specification: *.csv* and now when I run it, I only get one warning!  

 

Thank you both so much! :D

Labels
Top Solution Authors