We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Designer Discussions

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

Dynamic Input - Different Schema

mullinsjo
7 - Meteor

I am currently working on a workflow that brings in a bunch of excel files with various metrics. The way the current files are set up is using columns at the top with the month-year format. Some of the files have 2021 and some do not therefore when I run the workflow I get the error "has a different schema than the first file in the set." Is there a workaround for this?

4 REPLIES 4
morr-co
10 - Fireball

Hi @mullinsjo : I have not found a workaround for this with the dynamic input tool. However, you can create your own batch macro that accepts the file path (and sheet name, if Excel). The action tool can then update the file path value. In the Interface Designer, configure the macro to "Auto Configure by Name" so that it does not error when the file headers differ. An example of what the macro would look like is below.

 

Screen Shot 2020-10-22 at 3.04.43 PM.png

morr-co
10 - Fireball

Probably more useful to include the actual macro 🙃  You can pass a list of files into the macro - the full path - and it will read and output them. I have it configured to also give you the file name. With Excel, you must also add the sheet name to the full path. For example: {FilePathandName.xlsx}|||{SheetName}. There is a quirky thing with batch macros where it sometimes does not return the full results. If you notice this behavior add a Select tool afterwards and you should see everything. 

mullinsjo
7 - Meteor

@morr-co Thank you for your help!

Deliverance
7 - Meteor

Thank you @morr-co , this is exactly what I needed. I've solved the "different schema" issue a few times and can never remember how I did, or maybe it was different each time. It'll be nice to have a macro in my back pocket now. I passed this macro a list of inputs from a directory>formula tool which added the sheet name I need which was in each file.

Deliverance_0-1628521667911.png

 

Labels