Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Contains vs. FindString


Is there a benefit to using FindString != -1 vs. Contains as an if, then qualifier? I know the benefit of using contains is that it gives the case insensitive option which you can't do with findstring without uppercase([field]) or lowercase([field]), but is there a downside to using this over findstring?

Alteryx Certified Partner
Alteryx Certified Partner
👍 question!

If the context of the string is important, the findstring function let's you know where it was found. It can be very helpful if you are going to perform other string functions.

The regex_match function will give you super powers. Using it, you can be case sensitive or insensitive and add patterns as well counts of matches (regex_countmatches) to see if it contains many targets.

I hope that this helps you.


Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
FindString will actually tell you the position of the field you're looking for, whereas Contains just tells you whether or not it finds the string as a True/False answer.

So if you only need to know whether or not a string contains something else (i.e. "Green Apples" contains the word "Apple" but "Bartlett Pears" does not), then I would use Contains, especially because it has the option of making it case sensitive...

But if you need to know at which character "Apple" starts so that you can parse out anything in front of it, then you might want to use FindString.

Contains("Green Apples","Apples") = -1 (<-- Which in this case means True)
FindString("Green Apples","Apples") = 6

Hope that helps!


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.






You just need to use two FindString expressions - you can put them in the same formula with "or" in between:


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



I somehow have to pull versions from a specified lookup table which hold values like this:


Full Version:





Install paths are like this:

Installation Path





4 days to no avail please any help would be super appreciated. 

Alteryx Certified Partner

Hi @Kim_Donner 


Solution is attached. 





Although it's not in line with the original question, this is a great example to leverage RegEx. If only full version numbers are required then using the below in a RegEx tool with the Output method set to Parse will pull out the examples.



If the full path contains a non-version number (eg. TOMCAT, BOTOMCAT) and this is required - then by first trimming the field of '\' and '/' and then using the below RegEx replace to isolate the final component of the full path, these can also be obtained. 

trim([Field1], '\/')
if isnull([Full Version]) then REGEX_Replace([Field1], '.*\/|.*\\', '')
else [Full Version]


Hope this helps!

Awesome I started with RegEx and just couldn't get there. I think I see why given your response. I will test now. Thank you very much.