community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Use previous date information

Atom

I have a workflow that pulls an excel file from a folder for everyday in the prior month.  The files have the same name so it pulls the entire folder not just one spreadsheet.  The problem I have is the files that are sent to me are missing the days for holidays and weekends.  So for example: The folder will say MSTARNAV20181201, MSTARNAV20181202, MSTARNAV20181203, MSTARNAV20181206.  As you can see the dates for 04 & 05 are missing.  I need Alteryx to recognize the date gap and replace the missing files with the last date that it found.  Basically, I need stale data for the missing dates so the 04 & 05 data should be duplicates of 03 in this example..  I'm hoping there's a way to do that, thanks for any help you can give.

Alteryx Certified Partner
Alteryx Certified Partner

If I understand you correctly, you are asking Alteryx to COPY the file from MSTARNAV20181203 and create new files that are MSTARNAV20181204 and 05.  If that is correct, then an approach might be to generate a .bat file with the contents of:

 

COPY <Path>\MSTARNAV20181203.xlsx <Path>\MSTARNAV20181204.xls
COPY <Path>\MSTARNAV20181203.xlsx <Path>\MSTARNAV20181205.xls

Upon completion of this .bat file creation, you'll RUN an EVENT to execute the "WeekendCopy.bat" file that you created.

 

To find the missing dates, one approach might be to use a DIRECTORY input tool to see if there is a filename gap and then write these lines into the "WeekendCopy.bat" file.  Another approach might be to use a GENERATE ROWS tool to create the missing date entries and then create those .bat entries.  

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Quasar

@rworkman Probably a more elegant solution out there (likely with a .bat file) but this would also accomplish the same idea.

 

for the example, I just created dummy excel files with the file names you've mentioned

missing files.png

 

missing files workflow.PNG

 

 

From here you would want to attach a dynamic input tool that points to the filename.

 

Good luck!

Labels