Free Trial

Alteryx Designer Desktop Discussions

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

Pulling Latest File (csv) from each of seven folders

smoskowitz
12 - Quasar

Hi All --

 

I have been struggling with this problem for about 2 hours and have not gained any momentum. I have created the below folder structure. Admins will be pulling reports for each of the below seven networks and placing them in each of the below folders.

 

I am trying to create a workflow that will go into each folder, choose the most recent file and pull the data of each of the networks into a single spreadsheet, The data of each file will have the same number of columns. I attached one for reference. I tried building a macro -- but clearly, it is not yet my forte.

 

Looking forward to Inspire!!! 

 

Thanks,

Seth 

 

 

2018-03-20_15-22-25.jpg

5 REPLIES 5
BenMoss
ACE Emeritus
ACE Emeritus

What you need here is the 'Directory' tool which you should configure to point at the higher level folder. You should also check the 'Include Subdirectories' option.

You can also check for a particular structure in the naming convention using the 'File specification' textbox. Perhaps you just need to set it to *.csv.

After this you will get an input containing the full path of all the files that exist within that directory. Alongside details of the last write time and the 'directory' i.e. the folder.

I would then use a sort tool to sort firstly by 'directory' and then 'LastWrittenTime'.

By using the sample tool to then return the first record, and grouping by the 'directory'; this will give you the latest file within each directory (folder).

Finally! You can use the dyamic input to read from each of the files specified by the full path. Use the 'Change entire path' option, select the 'full path' field. And you must set a template, as you mentioned earlier each of your files should be the same, so you can set any of your original files!

I hope this helps!

Ben

LordNeilLord
15 - Aurora

Hey @smoskowitz

 

I'd use the directory tool...then summarize for each folder pulling back the max(Last Write Date).

 

Once you know this you can use the dynamic input tool to bring in each file. 

 

I'm just mocking up a demo but my computer isn't playing nice.

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

LordNeilLord
15 - Aurora

Like this:

 

Dynamic.PNG

LordNeilLord
15 - Aurora

Or what @BenMoss said

smoskowitz
12 - Quasar

Thank you, everyone! Both solutions were spot on!

Labels
Top Solution Authors