Good afternoon,
Hopefully someone has a crafty solution or alternative for my need. I would like to pull the latest available excel file (only available on business days) and a file for each available month end (last business day of each month). What's the best way to achieve this?
Example:
2020-08-11.xslx
2020-08-10.xlsx
2020-08-07.xlsx
....
2020-07-31.xlsx
...
2020-06-30.xlsx
Solved! Go to Solution.
This can be achieved relatively easily using the dynamic input tool.
Essentially, you'd import a list of all files in the folder. From there, you can actually sort and filter for the most recent file. The dynamic input tool will then use the file path to load the proper file.
See this article for more information and an example:
@echuong1 Thank you for recommendation. I tried this method, but unfortunately it didn't work given that some files have a different number of columns and therefore get skipped. Is there something else that I need to do to get it to work?
Yes, you will have to build a batch macro to import the data rather than the dynamic input. The beginning process will look the same when selecting the file path of the most recent file, but the dynamic input will be replaced with the macro.
See this article for information on creating the batch macro:
Hi @echuong1 , thank you for your help!