Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Looping through different tabs in excel file (input file)

zsibeko001
5 - Atom

Good day Team,

 

I am Zinhle and very new in this, really need your assistance.

I have one excel input file that has more than 20 sheets that I named Entry 1, 2,3...….

What I am trying to achieve is to design the workflow in such a way it execute Entry 1(sheet1) and create an output for Entry 1(sheet1). Automatically goes back and execute entry 2(sheet 2) create and output for entry 2 (sheet 2) until the last sheet in that one excel input file.

 

The overall purpose is to then create an analytics app.

 

How can I configure this.

 

Your help is appreciated. Thanks

3 REPLIES 3
neilgallen
12 - Quasar

What you're looking for is a batch macro, where the input tool is within the macro itself. 

 

The start of your workflow will be an input tool, but you would read the sheet names, and not any individual worksheet. Ensure that you have the option to output the full file path as a field as well.

 

From there use a formula tool to create the full input path, as alteryx requires a sheet name when inputting excel files. Something like

 

"[path]|[Sheet Name}$"

 

Route this list of sheets into your batch macro, using an action tool to update the input tool filename.

 

If you can provide a sample file then it's a pretty quick mockup!

 

Good luck.

 

zsibeko001
5 - Atom

Hi Neilgallen

Thanks for the response.

 

I have attached a screenshot of the work flow.

The first input on top is one sheet and its standard data that is later joined with the input at the bottom.

The input data in the bottom of the flow is one that is in a excel file with different tabs.

At which point in the flow steps can I drop the batch macro.

 

Thank you

 

jarrod
ACE Emeritus
ACE Emeritus

you will need to replace the excel input file with the batch macro. It's two steps if you don't know the sheet names. first step is to grab the sheet names, then second would be batch macro to open each sheet (batch macro)

Labels