I have a parent folder. Within that parent folder, there are multiple folders and within that folder, I have to extract all the sheets data into one big dataframe
This is what I mean:
Parent Folder - Multiple folders - Multiple Sheets- Different Schema
Within these excel files, there are multiple sheets.
e.g.
I want to extract all the sheets within one table with a column containing full sheet path so that i can then union the respective sheets to create a master information for "Contractor A", "Contractor B", "Contractor C", etc.
I have got the file names. Now, I am aware of this example that can read multiple sheets however, every sheet has a different structure and different columns with a very few common columns and column types and thus, I am getting error when I use the Dynamic input tool.
How can I get what I want?
Sounds like you need the batch macro option! It is attached and detailed here: The Ultimate Input Data Flowchart (alteryx.com)
Thank you for the direction however all the files using the macro are in the same folder. Also, the sheet structure is the same. I cannot use this case for my purpose.
You can still use it.... there's no harm using a Batch Macro. It just helps when you have a different structure too, this way it's dyanmically capable of handling the files. @alexnajm 's link still stands usable for your use case. :)
I tried as per the example:
Configured the macro as per the example
Ran the workflow after saving the macro
I get the error:
Error: Batch Correct (12): Record #1: Tool #1: No sheet specified, you must specify a sheet
I dont understand what's the best foot forward.
Do you mind providing some data? Let me fix it for you, please.
No, as in, can you provide 3 of your XLSX files? Then I can show you how. Not the Directory tool.
@HW1 you said in the original post that "every sheet has a different structure" so this would be the solution - It just requires a few more tools beforehand. You can read in the sheet names from each file with the Directory + Dynamic Input tool with the Output File Path option selected, get those sheet names added to those paths, and use that batch macro to read in the data.