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

Alteryx Designer Desktop Discussions

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

Combine multiple excel files and rename tabs to the file name

ZahinOsman
8 - Asteroid

Hi guys,

 

I'm trying to combine multiple excel files each having only 1 tab. When I combine them into a single output, I need the tabs to be renamed into their original excel file name

image.png

The output should look like this

image.png

 

Does anyone know how this can be done? Thanks in advance

9 REPLIES 9
flying008
15 - Aurora

Hi, @ZahinOsman 

 

Are the all .xlsx file have same fields and schema?

ZahinOsman
8 - Asteroid

Hi,

 

They all have the same fields and schema.

 

What if they have different fields? Would the join still be possible (Join all tabs into one workbook but separate individual tabs)

binuacs
21 - Polaris

@ZahinOsman Sample workflow attached

image.png

OTrieger
12 - Quasar

@ZahinOsman 

What you will need to do is to get the file name from the input data tool, and use it as the sheet name in the path. Sheet name is the text after the 3 pips |||.

Just set them as a variable.

ZahinOsman
8 - Asteroid

Hey,

 

Just to clarify, do I need to specify all the sheet names in the formula tab?

 

image.png

Sep_Corrections_EM Macro.xlsx

Sep_Corrections_FI Credit.xlsx

Sep_Corrections_FX.xlsx

Sep_Corrections_Rates.xlsx

 

 

If yes, lets say I want to run this workflow for the next month, so naturally the files will be renamed with Oct_ instead of Sep_, is there a way to avoid manually inputting the file name?

ZahinOsman
8 - Asteroid
binuacs
21 - Polaris

@ZahinOsman you need to only update the directory tool path

image.png

 

binuacs
21 - Polaris

@ZahinOsman for the dynamic month selection i added a filter tool in the workflow

image.png

ZahinOsman
8 - Asteroid

@binuacs owe you my life <3

Labels