Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic Input tool xlsx import error

criperc
6 - Meteoroid

Hello,

 

I am trying to import several files with the same file structure. 

 

A simplified example of how they are stored locally:

  • 01 Data
    • 05-14-2021
      • Demand.xlsx
      • Supply.xlsx
    • 05-15-2021
      • Demand.xslx
      • Supply.xlsx

They all have only one sheet name "Page 1"

 

I have used the directory tool to get the full path for all files

Then I have added a formula tool to create a new column name "FullPath_Sheet" with the formula [FullPath]+"|||Page 1$"

 

Then I add the dynamic input tool choosing one file as the Input Data Source Template, and in "Read List of Data Sources" I am choosing FullPath_Sheet and in action I am choosing Change Entire File Path but this leads to errors saying the files have different schema than the 1st file in the set. 

 

How can I solve this error? Thanks

8 REPLIES 8
AkimasaKajitani
17 - Castor
17 - Castor

If the Designer show the error as different schema, the files have different schema.

The schema is the field of name or type or etc.

And Excel files have often the invisible fields or the fields that have different data type, so it may be regarding as different schema.

 

In this case, you can't use the Dynamic Input tool. It can't be used for different schema.

You have to use batch macro instead of that.

 

The following workflow is a solution.

I attached it. Please refer it.

AkimasaKajitani_0-1621139888894.png

If you have any questions, let me know.

shreyanshrathod
11 - Bolide

Hi @criperc ,

A couple of pointers for you :-

               a)  The manner in which your files are stored, set the Directory location upto "01 Data" Folder and then CHECK the 'Include Subdirectories' option. (If you are reading all files under all dates)

 

shreyanshrathod_0-1621143118259.png

 

               b) If there is only one sheet per Excel file and all are named as 'Page 1', then you don't need to derive a separate [FullPath]+"|||Page 1$".

You can utilize the FULL PATH column provided by Directory tool that consists of entire location and the filenames.

 

               c) Check the order of the columns in all files. Your structure maybe similar, but if these columns are at different positions in different files, it will throw an error.

 

Attaching a dummy workflow that worked at my end according to your requirement.

 

shreyanshrathod_1-1621143314501.png

 

Regards,

Shreyansh Rathod

criperc
6 - Meteoroid

Hey, thanks for answering!

 

It's weird that alteryx thinks they don't have the same schema, all the files come from an ERP so all the files contain the same headers. 

 

Anyways, I used the workflow provided by you and it works! although I really don't understand it fully how macros work in Alteryx. Is there any chance to also add a column that indicates the fullpath source from which it came from? Do I need to add that function inside the macro? 

 

thanks again

criperc
6 - Meteoroid

Hello Shreyansh,

 

Thank you for answering! I appreciate it. Sadly, I keep getting this error. See attached screenshot. I filtered the "Demand" files because they all have the same headers (to keep schema consistent), and chose the first file in the batch as the template.

What am I doing wrong? 

Thanks again

 

 

 

shreyanshrathod
11 - Bolide

@criperc 

shreyanshrathod_0-1621145306718.png

 

While Configuring Dynamic Input (or if you Edit the input Data Source template), there is a property "Output File Name as Field". You can set it to "File path" or "Full Path" as per your requirement.

 

Regards,

Shreyansh Rathod

atcodedog05
22 - Nova
22 - Nova

 


@criperc wrote:

Anyways, I used the workflow provided by you and it works! although I really don't understand it fully how macros work in Alteryx. Is there any chance to also add a column that indicates the fullpath source from which it came from? Do I need to add that function inside the macro? 

 


Hi @criperc 

 

I have modified @AkimasaKajitani 's workflow to add your extra requirement. In his 2nd macro i have configured input tool to capture fullpath. Hope this works

atcodedog05_0-1621145520058.png

 

Hope this helps 🙂

SumitBansal
5 - Atom

Hi All.. dynamic input is not reading data from xlsx file while using download tool. It always through's me a error message of select tab even when table is already selected. It is working fine if the input data is in .csv format. Any kind of fix is greatly appreciated.

 

 

 

caltang
17 - Castor
17 - Castor

Maybe you can make your own post @SumitBansal  - necromancy by reviving an old thread may not be the best solution for you.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels
Top Solution Authors