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
Solved! Go to Solution.
Hi @Istwineres,
I have created a workflow for you:
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:
If this was a solution that you were after please mark my post as a solution!
Could you attach the workflow? Thanks
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.
Hope that helps, please let me know if that works for you.
Cheers,
Angelos
Hi @Istwineres,
I have attached my workflow to the previous post.
So many possible solutions, many thanks all!