Free Trial

Alteryx Designer Desktop Discussions

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

formula so that if a certain number is between two dashes workflow pulls

Ksisterhen
8 - Asteroid

I am trying to set up a formula so that if a file name contains a certain number between two dashes i pull the file in.

 

example if a file name has a 2 between the dashes or a 7 then i want to pull that file in.

 

example file names:

daily pull 12-2-2023

daily pull 12-5-2023

daily pull 12-7-2023

daily pull 12-8-2023

daily pull 2-5-2023

daily pull 2-6-2023

daily pull 2-7-2023

daily pull 2-2-2023

 

 

work flow pulls these files from that group

daily pull 12-2-2023

daily pull 12-7-2023

daily pull 2-7-2023

daily pull 2-2-2023

 

8 REPLIES 8
shancmiralles
11 - Bolide

hi! use a filter tool 
then on the configuration  choose the "custom filter" and use the formula below:

Contains([FileName],"-2-") OR
Contains([FileName],"-7-")

hope this helps! 

Ksisterhen
8 - Asteroid

hi- just realized the format is yyyy-mm-dd, so how do pull files that just has the 2 or 7 at the end and not also as possible month value?

Bren_Spill
12 - Quasar
12 - Quasar

@Ksisterhen - the attached parses the date from the file name, and then filters on the day. Doesn't need to be done this way, but figured having the date could be useful in other parts of your workflow too.

 

Thanks!

Ksisterhen
8 - Asteroid

so ideally i actually want the filter to pull if the date # is today, tomorrow or yesterday so for today if i were to run the workflow i would want the workflow to pull files with a day date of the 16th, 17th or 18th, how can i make the filter dynamic like that? and tomorrow pull files with date numbers 17,18,19 

Bren_Spill
12 - Quasar
12 - Quasar

@Ksisterhen - see attached!

shancmiralles
11 - Bolide

Just use the formula I gave you and change the "-2-" to "-2" .. do the same for the 7... 

 

 

Ksisterhen
8 - Asteroid

nvm figured it out, thanks for all your help!

 

shancmiralles
11 - Bolide

Hi! im really confuse about your inqiury... 

please see filter tool.. 
just make sure your data set is already in data type.. (that mean you already parsed your filename)..

you can get the files dated today via basic filter (column date = Today ) which are all provided to you in drop down options..

 

today can be changed to yesterday and tomorrow ..

there is the "Fixed"  option where you can choose a different date through a calendar that will show once you pick "fixed" 

if you are new and find it hard to use a custom filter do  1 filter tool per date... and use a union tool to combine them all (this is where i started).. 

Labels
Top Solution Authors