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

URGENT: How to input specified sheet for multiple excel files(xlsx) in alteryx

vaibhav_jain
8 - Asteroid

Hi, 

Have created a Batch macro for reading multiple sheets for multiple excel files. However, i want to read only first sheet for all the 3 files.

 

sample data attached along with the batch workflow. Please guide how i can specify a particular sheet to be read.

8 REPLIES 8
DultonM
11 - Bolide

Hi @vaibhav_jain! One option is to put a Sample tool right after your Input in the batch macro so that only the first record reaches the Dynamic Input tool (aka only the first sheet per batch is read). If you know the sheet's name in advance, you could add a filter in that same spot and add an interface tool to the filter that will allow you to enter the sheet name(s) you wish to keep. Hope this helps!

pcatterson
11 - Bolide

I've created a macro that I believe will be of help.  It gives you the option to not only see the files within a folder, but also shows the sheets within an excel file as a new field called FullPathAndSheet.  Then you can use a filter to specify which sheets you want to collect in the data and then run your batch macro.

vaibhav_jain
8 - Asteroid

Hi,

When i am opening the macro, getting a ?. The macro is not attached properly. Please suggest.

pcatterson
11 - Bolide

Sorry, there is a macro within a macro situation.  You'll need this one as well.

vaibhav_jain
8 - Asteroid

Hi DultonM,

 

I have applied your logic of applying filter for selection of sheet1. The macro is working fine however when i am using directory tool to read the three files, its showing error. PFA workflow. Please guide.

 

vaibhav_jain
8 - Asteroid

Main workflow

pcatterson
11 - Bolide

I use an older version of Alteryx, so I cannot open your workflows.  Sorry

DultonM
11 - Bolide

Hi @vaibhav_jain,

 

I don't know if you're still having troubles with this workflow, but in response to your latest post, it appears that the Action Tool connected to the filter in your macro is replacing the entire filter expression with the full path from the Control Parameter. Is it always Sheet 1 that you wish to input? If so, you shouldn't need any interface tools connected to your Filter. Also, I happened to notice that a Browse tool in your main workflow went rouge and doesn't have an input connection.

Labels