Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Findstring for 2 or more values

Mancunian
8 - Asteroid

I have a coloumn with all months and years since 2011, but I just need to extract the years 2016 and 2017. How can I specify these 2 years in a single FindString Formula.

 

The data is  april, 2016, May, 2013, January 2017

 

I have been trying this but to no avail.

 

FindString([DateTime_Out],"2016"&"2017")>-1

3 REPLIES 3
Kenda
16 - Nebula
16 - Nebula

Hey @Mancunian! I would add the following expression to a Filter tool instead of using the FindString. Does this still accomplish what you're wanting?

 

right([Field1],4)="2016" || right([Field1],4)="2017"
MarqueeCrew
20 - Arcturus
20 - Arcturus

Hi @Mancunian,

 

Please try one of these formulas (whichever tickles your fancy):

 

regex_match([Field1],".*2016.*|.*2017*")
Contains([Field1],"2016")
OR
Contains([Field1],"2017")

You could even use Findstring if you use the OR construct.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
jdunkerley79
ACE Emeritus
ACE Emeritus

An alternative to @Kenda

right([Field1],4) IN ("2016", "2017")
Labels