Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Search for incoming data source

kaitturner
5 - Atom

I am looking to pull in two data sources for a workflow I created to compare two datasets.  The storage location for the data should always be the same and the name of the datafile is the same beginning with a date stamp as the differentiator.

 

Example:

Quarterly_Tech_Plan_Report_yyyymmdd.xls

Capture.PNG

 

Is there a way to ask Alteryx to pull the latest and second to latest data sources as inputs?

3 REPLIES 3
patrick_digan
17 - Castor
17 - Castor

@kaitturner I think you can use the directory tool and then the dynamic input tool to accomplish this. I've attached a quick sample using txt files. In the directory tool, the .\ means search the current directory. You could certainly specify a directory (like C:\Data). The formula tool is grabbing the date. Then I sort by date and use the select records to grab the first and second records (latest and second latest). The dynamic input is setup initially to grab one of the files, and then i use fullpath field to instead pull in the latest or second latest file.

 

You'll want to setup your directory tool to find xls files in your specified folder and then setup your dynamic input source template to read one of those files.

 

Hope that helps!

NicoleJohnson
ACE Emeritus
ACE Emeritus

You might try combining the Directory tool with a Sort, Sample, and Dynamic Input tool...

 

Directory brings in all the file names in a specified location (you can include the first part of the file name and a wildcard * for the yyyymmdd portion)... you could then sort by CreationTime... select the first record (for the top branch) or the second record (for the bottom branch), and then run those file names through Dynamic Input tools, reading a list of data sources that contains your file name (note, for Excel files, you will need to add a tab/sheet name to end of your file path for it to work).

 

Does that help you out?

 

(Alternatively, if sorting by date created doesn't give you consistent results, may be able to use date formulas to determine the two yyyymmdd portions of the file name based on today's date, and then use that to generate the file name used in your Dynamic Input tool... let me know if that seems like a better route!)

 

Cheers,

NJ

kaitturner
5 - Atom

Thank you! Can you send the workbook in a backwards-compatible file?  I am running 10.6

Labels