Free Trial

Alteryx Designer Desktop Discussions

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

Extract current day file and previous day file from a folder

spunyar
5 - Atom

Hi Everyone,

 

Need your suggestion how to dynamically pick up the latest file and previous day file from a folder.

 

I want to do D-o-D comparison of data from 2 files (current day and previous day). 

Daily in a folder I receive 3 files from a batch process for e.g. file names as 2024-10-22, 2024-10-22_1 and 2024-10-22_2. Also these files contains 3 different sheets.

 

Is it possible to create a workflow with the help of directory tool or macro to pick up daily latest file e.g. 2024-10-22_2 and previous day most recent version e.g. 2024-10-21_2? I need all 3 sheets from these files for comparing d-o-d data.

 

I have attached sample files.

 

 

 

 

 

 

3 REPLIES 3
Garrett_Stoker
8 - Asteroid

There is probably some optimization to be done here, but it functions. Using the Directory tool, you can bring in the full paths, parse the data to limit the list to only the 2 most recent days and versions, and feed that into the Dynamic Input to bring in worksheets. I'm not sure if it's possible to do it all with one Dynamic Input (I don't have a ton of experience with them), but you could append the worksheets to the full paths to pull each pair.

Screenshot 2024-10-23 133736.png

binuacs
21 - Polaris

@spunyar Are you planning to compare Details from the current file to Details from the previous file, Current Template info to previous Template info ? If you are using a batch macro it will combine all the sheets from both current and previous files into one output which will be difficult for the comparison, 

spunyar
5 - Atom

Thanks Garrett, this flow worked :)

Labels
Top Solution Authors