In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Searching sub string in a string

Abhii2658
8 - Asteroid

I am trying to find a substring in a string and return the value 1 if it finds it. 

Example. 

(Contains([Vendor/supplying plant], "ABC", 1)
OR
(Contains([Vendor/supplying plant], "DEF", 1)
OR
Contains([Vendor/supplying plant], "GHI", 1))
then 1

 

 

ABC Logistics Returns 1 but it also picks other values Such as 

dataabc1234 Returns 1 as well. 

 

I just want value to be set as 1 only when ABC or ABC is an exclusive word and not a substring in another string. 

 

Please suggest. 

2 REPLIES 2
Christina_H
14 - Magnetar

Try this:

(Contains(" "+[Vendor/supplying plant]+" ", " ABC ", 1)

Added spaces to the beginning and end of both string and substring.

Abhii2658
8 - Asteroid

@Christina_H  awesome thank you. 

Labels
Top Solution Authors