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

Running a Batch Macro on Multiple Tabs in the Same Excel File

chester50
6 - Meteoroid

Hello, 

 

Is it possible to run a batch macro on multiple tabs of the same Excel file? I attached a workflow that I'm working on with the macro that I'd like to run on all of the tabs individually in the Sample Input. Could I get some guidance configuring the control parameter of the macro so that the macro will run on all of these tabs and produce an output similar to the target output file I also attached? 

 

Thanks so much!!

6 REPLIES 6
ydmuley
12 - Quasar
12 - Quasar

Hello @chester50 - Why not first pulling in all the data from multiple tabs and later using the macro to achieve the desired outcome.

Regards,
Yugandhar Muley (Yug)

Alteryx ACE | Alteryx For Good India Lead | Bengaluru Alteryx User Group Lead
chester50
6 - Meteoroid

Hi @ydmuley - thanks for the suggestion. When creating the sample data used in the workflow I uploaded, I really simplified it just for demonstration purposes. In my real input file, each entity tab will not have a consistent number of state fields, as our export only populates columns for tabs that have activity in each state. So when I try to use the dynamic input approach, the dynamic input tool skips tabs with the error message "The file XXX has a different number of fields than the 1st file and will be skipped", thus meaning that many of the tabs do not make it through the dynamic input. That's why I was attempting to use the batch macro approach - do you know if that would be possible? 

swoo008
6 - Meteoroid

I'm curious to see what you ended up doing with this? 

mmishal001
8 - Asteroid
jrgo
14 - Magnetar

@chester50 

 

You were almost there. The main issue to why your macro wasn't working is because your Control Parameter configured to update the input tool with the field you selected, which you had just the sheet name going in.

 

Using a formula tool, created a new field to contain the full file path, including the sheet name, and used that field for the control param.

 

I also made some modifications to your macro so that it's able to properly parse out the sheet name.

 

Reach out if there's any questions to the changes i made, but hopefully this helps!



Jimmy
Teknion Data Solutions

itahir04
8 - Asteroid

Hi Jimmy,

The question is how to construct the batch macro to read multiple tab. In you rworkflow, you are using a batch macro which is already constructed, saved, and then used.

Can you please send me the configuaration part of the batch macro.

I have a fle with multiple tabs, I would like to run workflow on each tab and union the data to get a master data file.

 

Thanks,

Rana

Labels