Alteryx Designer Desktop Discussions

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

XLS Dynamic Input

clarrock
Astéroïde

Hi Team

 

I have a file that is in xls format.. And whose table name or sheet name changes everyday

How do I use the dynamic input tool to input the file from a directory

 

I seem to get errors when doing so. 

Please do send a simple workflow with a template you used - it would be really helpful

 

Thank you

18 RÉPONSES 18
Emil_Kos
17 - Castor
17 - Castor

Hi @clarrock ,

 

The solution that will take the newest file from a particular folder will work for you? 

 

If yes please check this link for a sample workflow:

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-to-dynamically-run-the-most-rec...

Qiu
20 - Arcturus
20 - Arcturus

@clarrock 
I think this should work for you.

Révélation
1013-porpergrey.PNG
clarrock
Astéroïde

@Qiu I think your taking a xlsx file from the directory tool not an xls file..as I get this error

16025761106571376595098284059459.jpg

atcodedog05
22 - Nova
22 - Nova

Hi @clarrock 

 

xls is a old version(97–2003) of xlsx. Alteryx cant directly read sheet names of xls. 

 

Here is a post where python code is used to read xls sheet names.

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Listing-the-list-of-sheet-names-from-X...

 

Additionally if you can rename extension xls to xlsx it will be more flexible.

atcodedog05
22 - Nova
22 - Nova

Hi @clarrock 

 

Was able to crack it. 

 

Workflow:

atcodedog05_0-1602577897021.png

Make sure you select the folder with files in the directory tool.

 

Output:

atcodedog05_1-1602578137643.png

 

Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

 

 

clarrock
Astéroïde

Hi @atcodedog05

This is a good solution

 

But I'm getting this error -  what could be the reason 

Please advise

 

16025838702946851415435150111317.jpg

 

atcodedog05
22 - Nova
22 - Nova

Hi @clarrock 

 

Can you share the complete screenshot which tool is causing this issue.

I can help you based on that.

clarrock
Astéroïde

@atcodedog05

 

It's append fields

16026146804819104407577162570903.jpg

mceleavey
17 - Castor
17 - Castor

Hi @clarrock ,

 

I've written a couple of useful macros for this.

 

I've attached the example workflow and the tools. The first macro dynamically reads in the sheet names from all .xlsx files (you'll need to change the extension references to .xls but the functionality is the same). These can then be attached to the fullpath field and fed into the second macro to load them in.

You can apply filters to remove the ones you don't want, and you can sort by creation date descending and sampling the first 1 to take the latest (grouping by name if you want the latest one for each filename etc.)

 

Anyway, I hope this helps.

 

M.



Bulien

Étiquettes