Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
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