Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Dynamic Databases creation

ash86
5 - Atom

I would like to create a workflow where i read multiple excel files and then create one table for each file and write it to a database.

 

Schema of each file could be different

 

Can someone provide a sample workflow for the same having 3 or more different excel files

1 REPLY 1
MattBSlalom
11 - Bolide

I've written several similar answers in other threads.  Are your Sheet Names in the files variable or something constant like "Sheet1"?

 

Assuming your sheet names are constant (or at least predictable, like the sheet name is the same as the file name) then the below sample should be what you need.

 

This scenario is perfect for a Batch Macro.  The Control Parameter will be used to drive selection of a single source Excel file / sheet.  The sample below is a workflow that gets file names from a directory, then calls a macro to take action on each file.

 

The macro will handle the activities you'd perform against a single file like writing it to a separate database table.  The macro will be called by a parent workflow that passes in the list of files to take action on.  In my sample macro I've got a placeholder Container with a dummy Filter tool that you'd replace with any actual logic needed on the data in a given file.

 

Simple parent workflow to gather file names and pass into batch macro:

MattBSlalom_2-1617911416250.png

 

 

Sample Batch macro to process 1 file at a time:

MattBSlalom_3-1617911465158.png

 

 

Labels