Alteryx Designer Desktop Discussions

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

Formula tool to extract input files that are in a folder that end with yesterday date

APIUserOpsGiri
7 - Meteor

I have to extract files inside a folder that ends with yesterday's date For example folder name is "abcd_2023-02-06".

 

The suffix of the file needs to have yesterday's date in this format "_YYYYMMDD" and I need to extract all the files inside that folder.

4 REPLIES 4
binuacs
20 - Arcturus

@APIUserOpsGiri One way of doing this is by checking the included subdirectories option in the directory tool then filter out the directory name the file name

 

binuacs_2-1675705659555.png

 

 

binuacs_1-1675705591467.png

 

 

ShankerV
17 - Castor

Hi @APIUserOpsGiri 

 

Please find the expected output.

 

All the files in the directory will be read. For the use case I have created only one file to explain.

 

ShankerV_0-1675705454457.png

 

Many thanks

Shanker V

 

APIUserOpsGiri
7 - Meteor

This gets me inside the directory, but I want files inside the directory, how can I make it get the files inside it???

binuacs
20 - Arcturus

@APIUserOpsGiri the below filter condition will first check for the directory then the second condition will filter the file with yesterday's

//extract the directory with the name YYYY-MM-DD
Contains([Directory], DateTimeFormat(DateTimeAdd(DateTimeToday(),0,'day'),'%Y-%m-%d'))

AND

//extract the files with the name YYYYMMDD

Contains([FileName], DateTimeFormat(DateTimeAdd(DateTimeToday(),-1,'day'),'%Y%m%d'))

date in the format YYYYMMDD format

 

 

Labels