Alteryx Designer Desktop Discussions

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

How can I have different schema when importing a list of sheet names?

nrubner1
7 - Meteor

I am trying to run a batch macro with a series of files that all have different tab names, so I want to use a dynamic input to first read in all of the tab names. However I'm getting an error that some of the files have a different schema. I'm not sure how this can be given that Alteryx defines the schema of the list of sheet names ?

10 REPLIES 10
grossal
15 - Aurora
15 - Aurora

The error means that some of the tabs have a different schema. For example one has 3 columns and another one has 4 or more.

 

You could use the Wildcard Input macro from the CReW macros (http://www.chaosreignswithin.com/p/macros.html) to work around this.

 

nrubner1
7 - Meteor

Can you explain why the number of columns within a tab affects the list of the sheet names that is being read out?

 

Thanks for the link, got the crew macros already but hoping to find a solution that is scale-able

grossal
15 - Aurora
15 - Aurora

You get the error during the import of the sheet names? I thought you get the error in the Dynamic Input tool.

 

 

nrubner1
7 - Meteor

I am (trying!) to use the dynamic input tool to read in the list of sheet names. First I use a directory tool, then a formula to add [FullPath]+"|||<List of Sheet Names>" and then run that through the Dynamic Input tool to get out a full list of the files and tab names

AbhilashR
15 - Aurora
15 - Aurora

Sorry to jump-in out of turn here @grossal. I posted a similar solution today in another thread that might help @nrubner1.

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/How-to-Check-if-an-excel-file-exist-an...

 

I have attached the solution here for quick reference.

grossal
15 - Aurora
15 - Aurora

In the end, do you want to read in all the sheets from all the excel files within one folder (and subfolders)? If yes, I'd actually recommend to use the macro @afv2688 posted in this post where I asked about it. This saved my a lot of work when I tried to work with it.

 

My scenario was sth like

Excel 2016.xlsx (12 sheets)

Excel 2017.xlsx (12 sheets)

Excel 2018.xlsx (12 sheets)
Excel 2019.xlsx (12 sheets)

Excel 2020.xlsx (12 sheets)

 

and I wanted to import all sheets. His macro does this all in one.

 

grossal
15 - Aurora
15 - Aurora

@AbhilashR: no worries, helping does not need an apology 😃

nrubner1
7 - Meteor

Thank you both - just tried this with my files and I can get to the point I want at the tool before the second macro. Will try with other similar scenarios. Thanks again! 

garretwalters12
8 - Asteroid

@AbhilashR  I tried this but now receiving an error from the macro saying "The field schema for the output changed between iterations". I am also just reading in a list of sheet names so I am unsure how this is possible

Labels