Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Detecting the correct input file when file names change

Jake5
8 - Asteroid

Hello,

 

I have a workflow where ideally the user places two input files into one folder, with each file following the naming convention of R00846_WMMYYAM.txt with "MM" being the month and "YY" the year .  One of the inputs represents data for the prior period (e.g. R00846_0723AM.txt) and the other for the current period (e.g. R00846_0823AM.txt).  In Alteryx, I have an input tool for each (prior period and current period).  Is there a way to have Alteryx work off the MMYY value in order to determine which file to associate with which input? 

 

Thanks.    

4 REPLIES 4
binuacs
21 - Polaris

@Jake5 Use the directory tool read all the input files and filter out the file names which dont fall on last month

image.png

rzdodson
12 - Quasar

@Jake5 definitely a couple of ways to tackle this one. Assuming the nomenclature is always the same for the file names and are saved in sequence (re: current file, previous period, 2x previous periods ago, etc.), you can have a Directory tool bring in the file names, grab the two most recent files, and then bring in that data to separate streams entirely.

 

Solution.png

 

Inside the macro

 

Settings change.png

 

 

akvsachin
8 - Asteroid

Hey @binuacs 
Can we do this while using FileBrowse & Action Tools ?

 

binuacs
21 - Polaris

@akvsachinyes,  you need to connect with folder Browser tool then connect with action tool

image.png

Labels