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

Import dynamic sheet name

VEDH
8 - Asteroid

Hi All,

 

I have 3 types of file to import daily in my workflow.

1 .CSV

2 .XLS

3 .XLSX

 

Each file has different sheet names everyday. How do I import them as there is no option to wildcard sheet name.

 

 

7 REPLIES 7
echuong1
Alteryx Alumni (Retired)

This would really only be an issue for the Excel files. You can read in the files as only the list of sheet names and paths. From there, you can use a dynamic input to read in the sheet.

 

Take a look at the tool mastery series for more information:

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Dynamic-Input/ta-p/249... 

VEDH
8 - Asteroid

Hi @echuong1 

 

I tried almost everything. nothing helps!

 

Do you have any update? As when Allteryx will implement wildcard in sheet names?

 

echuong1
Alteryx Alumni (Retired)

Are you able to upload a copy of your dataset?

VEDH
8 - Asteroid

Due to data confidentiality, I could not share the exact dataset.

However, I have created my own dataset with different sheet names.

T_Willins
14 - Magnetar
14 - Magnetar

Hi @VEDH,

 

Thanks for providing a sample dataset.  It makes it easier to give a complete workflow.  Attached is a solution to your issue using a Batch Macro.  The workflow uses a Directory tool to find all the .xlsx files in a given folder.  The macro then looks at each FilePath one at a time to find the worksheet(s) in each workbook, adds the worksheet to the filepath, then uses a Dynamic Input tool to read the data from the worksheet(s).  It loads the data for each worksheet in each file, then outputs all the data to the Macro Output.  This will work as long as all the worksheets have the same schema (same columns, columns have the same datatype in each file).  Let us know if you have questions or need additional assistance.

 

Batch MacroBatch Macro

 

WorkflowWorkflow

 

VEDH
8 - Asteroid

@echuong1  and @T_Willins 

 

I happened to use the below and it worked perfectly fine for me.

 

VEDH_5-1619780066755.png

 

 

VEDH_6-1619780078464.png

 

 

VEDH_8-1619780117587.png

 

 

 

mosellecu
5 - Atom

Hi @T_Willins

 

I have tried using your macro and main workflow. All files are read, however since I configured the dynamic input tool in the macro to output the file name, it only outputs the file name of the template file in the macro.

 
 

What should I do if I want the correct file names per file to appear using this macro?

 

Thanks in advance.  

Labels
Top Solution Authors