Alteryx Designer Desktop Discussions

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

Merging multiple files together with different number of columns.

AshaCharis
7 - Meteor

Currently I am using a batch macro process to combine files on top of each other, however each file has a different amount of columns, and my batch process only looks at matching the same column in the same space each time. Files are continuously added to the folder every day, so the merged file is updated 2x a day through the gallery.

So when the batch process runs on my files, the macro doesn’t see the same column titles to stack on top of each other, so it ends up creating new columns.

 

I would like to stack the same columns on top of each other and be able to add any columns that are new in the merged file. 

 

I have attached some sample data for clarity. 

15 REPLIES 15
RishiK
Alteryx
Alteryx

@AshaCharis I was testing out a macro built by @apathetichell on your Excel sheets and I think it produces what you want as attached.

atcodedog05
22 - Nova
22 - Nova

Hi @apathetichell ,

 

You should publish this on Alteryx public gallery 🙂

apathetichell
18 - Pollux

@atcodedog05  - Done ! - thanks for the support @RishiK.

AshaCharis
7 - Meteor

Thank you so much for your help.

 

The files that are coming in are in .csv; do I just need to create another empty file sample the batch off of?

AshaCharis_0-1627339311655.png

 

apathetichell
18 - Pollux

oh - that is a totally different project and a bit easier.... My macro is for different schema .xlsx/.xls - try the attached for .csv

apathetichell
18 - Pollux

oh - did you want a combo macro which reads in any of .xlsx,.xls or .csv? It's possible but I haven't done it yet

AshaCharis
7 - Meteor

In the macro I wanted it to do is to stack the same columns on top of each other and be able to add any columns that are new in the merged file, but the macro that you first provided seems to not like the fact that I am stacking csvs.

apathetichell
18 - Pollux

Try this one...

 

@RishiK- updated version which spits out filename and allows for .csvs to be read in...

RishiK
Alteryx
Alteryx

Thanks for that @apathetichell 

Labels