ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now

Alteryx Designer Discussions

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

Search the most recent files

Istwineres
8 - Asteroid

Hi, I'm looking for a solution for the search of the most recent files through the input directory. The filenames are all formatted the same way: xyz_ddMMyy, abc_ddMMyy and so on. I want to extract the most recent respect to the month and the second one always respect to the month. For instance today I'd look for January and December files. Files can be more than one for each month

Emil_Kos
16 - Nebula

Hi @Istwineres,


I have created a workflow for you:

 

Emil_Kos_1-1614348025659.png

 

I have used the date from the file name in order to create a flag that shows everything newer than 2 months from now. The second filter is removing the current month.

 

Please review and let me know if I need to amend it somehow:

 

Emil_Kos_2-1614348047010.png

If this was a solution that you were after please mark my post as a solution!

 

 

Istwineres
8 - Asteroid

Could you attach the workflow? Thanks

AngelosPachis
15 - Aurora

Hi @Istwineres ,

 

Assuming that you get many different fields from the directory tool (but we only need the field [FielName] for the task) you can use a Regex tool to parse out the date. 

 

Then with a formula tool, you can bring it in a format that alteryx understands as dates, sort them and then only keep the 2 most recent dates with a sample tool. The last step can be swapped with a recordID and filter tool, which will only keep the top 2 records.

 

AngelosPachis_0-1614348381235.png

 

Hope that helps, please let me know if that works for you.

 

Cheers,

 

Angelos

Amarendra
10 - Fireball
Emil_Kos
16 - Nebula

Hi @Istwineres,

I have attached my workflow to the previous post. 

Istwineres
8 - Asteroid

So many possible solutions, many thanks all! 

Labels