Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Combine Excel sheets with different column order

Mario36
8 - Asteroid

I need to merge an excel file with same data on all tabs but the column order is different. I did try dynamic input tool but it merged based on position.

12 REPLIES 12
alexvornsand
7 - Meteor

Hi @Mario36, it's funny that the dynamic input tool doesn't have an option for configuring based on name. Maybe this is something you could submit as a suggestion? I was able to solve your issue by outsourcing the Union portion of the tool to a macro. See the attached workflow. Basically, the macro does the work of bringing in each sheet, but then the macro output is stacking the data (specifically by name).

gabrielvilella
14 - Magnetar

There is an idea for this topic, if more people could upvote it Alteryx may consider it. 

https://community.alteryx.com/t5/Alteryx-Designer-Ideas/Read-in-multiple-files-tabs-with-different-f... 

mceleavey
17 - Castor
17 - Castor

Hi @Mario36 ,

 

I built a couple of tools to do this.

The first reads the Excel tab names, these are then added to the fullpath and the second tool loads them all in and merges them according to the column names.

I hope this helps,

 

M.



Bulien

JosephSerpis
17 - Castor
17 - Castor

The Batch Macro approach highlighted in this article should help as you can merge by name and postion.

 

Batch_Macro_07022022.JPG

Mario36
8 - Asteroid

Thank you everyone for your solutions. What if one or more columns have the same data but the column names are a bit different from the rest.

Sheet 04 on the attached excel is the one I wanted to be merged.

@alexvornsand Your solution wasn't able to append all the data. I believe they appended only the common items.

Mario36_0-1644318269953.png

 

@mceleavey Your solution helped. Could you assist in resolving the above block ?

Mario36_1-1644318478391.png

 

mceleavey
17 - Castor
17 - Castor

Hi @Mario36 ,

 

If your column names are different then you will need to rename them. There's no way for Alteryx to know they're the same.

If your columns are named consistently different then you can use a mapping input and the Dynamic rename tool to rename.

However, you will need to split them on filename rename, then union.

This is a stark example of Excel being a really bad data source.

 

M.



Bulien

Mario36
8 - Asteroid

So nothing can be done by grouping them by data type or size ?

 

mceleavey
17 - Castor
17 - Castor

Hi @Mario36 ,

 

can you explain what the problem actually is? 

The example you gave loads perfectly through the tool I provided. Can you give an example of a problem you're trying to resolve?

 

M.



Bulien

Mario36
8 - Asteroid

This is what I want to achieve

ProductCostQuantityDate
Apple100102/7/2022
Mango120122/7/2022
Apple100102/5/2022
Orange15082/6/2022
Banana95182/1/2022
Grape8592/3/2022
Grape65122/10/2022
Plum8052/6/2022
Guava15022/10/2022
Papaya10052/6/2022
Melon60122/4/2022
Guava15022/10/2022
Papaya10052/6/2022
Melon60122/4/2022
Labels