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

Dynamic Input to read list of excel files from Directory

haya
8 - Asteroid

Hi All,

 

I am facing an issue while using the dynamic input to read list of files from a directory.Can anyone help asap as I am stuck with this on a project.

 

Requirement :- To read all the files from a directory.

 

The file names are as follows 

 

1)Air_Jan.xlsx

2)Air_Mar.xlsx

 

This is the folder I am talking about :- Both excel sheet name is AirData

 

File Path.PNG

 

Screenshot of directory configuration

 

Directory Path.PNG

Screenshot of Dynamic Input configuration

 

Dynamic Input.PNG

 

But I am not able to read Air_Mar.xlsx.Getting below error.Can somebody help me on this?.

 

Error.PNG

 

Any help would be really appreciated.

 

Regards,

Haya

12 REPLIES 12
DavidP
17 - Castor
17 - Castor

Ok, so have a look at the differences between the 2 files below - check the data types

 

field differences.png

 

You have 2 options:

 

1. Change all fields in Excel to Text to make sure they're all all the same.

2. Write a batch macro that can read files both files and union them.

 

Luckily, the 2nd option is really simple and here is an excellent article that explains how to do it.

 

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/CS-Macro-Dev-Reading-in-multiple-files-with-...

 

I've also gone ahead and written the macro for you - please see attached and also the workflow that calls it. Note that the files have a lot of nulls rows, so to see the real values, you just have to filter the nulls out.

 

 

haya
8 - Asteroid

Hi David,

 

Thank you for the solution.Now what I am facing issue is I am not able to write the output of the macro into a tde.The file is getting created but however it has only 30KB.Not sure what I am missing here.My output has to be a tde which can connect to tableau file.Can you please help?.

I tried with .xls  format with this macro however it is not reading the second file.

 

With .xlsx and .csv it is reading Air_Mar and Air_Jan files however not writing the output as a tde.

 

Any help would be really appreciated.

 

Regards,

Haya

DavidP
17 - Castor
17 - Castor

I am not experiencing the same problem, I added an output tool to the workflow with the sample file you provided and it generated the correct tde file - see below.

 

tde output.pngtde output 2.png

Labels