Alteryx Designer Desktop Discussions

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

Most Recently Created File Filtering With Directory and Dynamic Input Tools

MarshallG
8 - Asteroid

Hi All-

 

Is there a way to use the Directory and Filter tools to select a Directory, look through the files, and then filter to only the most recently created file based on the file metadata.

 

My example below allows me to filter on the files that were created after 11/01/2015, but I want to access just the newest file.

 

Screenshot.PNG

 

12 REPLIES 12
chris_love
12 - Quasar
Hi

If you use a directory, followed by a sort on Creation Date, followed by a
Sample to take the first one record, this will give you what you need.

Chris
MarshallG
8 - Asteroid

Thanks, Chris. I knew it had to be an easy one, I just couldn't come up with the right terms to search for my question.

TylerN
7 - Meteor

Chris, any idea as to why the dynamic input tool would then fail afterwards. This could be a seperate issue but figured I'd ask.

 

Alteryx Dynamic Input Error.PNG

 

RodL
Alteryx Alumni (Retired)

The Dynamic Input tool will behave differently depending on the file format. 

Looks like you might be trying to read in Excel files?

TylerN
7 - Meteor

That's correct Rod and they're the older xls style files.

RodL
Alteryx Alumni (Retired)

Not sure if the old XLS files behave the same way, but for XLSX files, I will add a Formula tool before the Dynamic Input that adds the Sheet Name to the Full Path from the Directory tool. 

Alteryx is expecting to have the sheet name defined (you can see this when you have a regular Input tool connecting to an Excel file).

The expression in the Formula tool could be something like...[FullPath] + "|Sheet1$".

TylerN
7 - Meteor

Thanks for that background Rod. I did as you suggested at it worked perfectly.

mbiermann
5 - Atom

Could someone please post that module so I can see how you are configuring that dynamic input tool?

rmwillis1973
8 - Asteroid

Similar problem as above - I have a folder which contains a number of zipped csv files.  I can select the newest file only - that part works fine.  I can create the sheet name field using the formula tool, which changes every week.  But then when I try to use the dynamic input tool, it doesn’t extract out any data.  It works ok, but just doesn't extract any data. 

 

I created a new field called filepath2 which is [FullPath]+"|"+[sheet name]+"|".  Again, there are no outputs from this.

 

What am I doing wrong here?

Labels