Free Trial

Alteryx Designer Desktop Discussions

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

how to find an exact match in a string

khap
7 - Meteor

Hi,

 

I am looking for a string function to find  an exact match in a string.

For example,  a field with values, "ABC222","ABC", "ABC123". if I use findstring() or contain() function to find a value of "ABC", it will return the 3 values, but I only want to return a record with a value "ABC", not all 3.

 

Thanks

6 REPLIES 6
Kenda
16 - Nebula
16 - Nebula

Hey @khap! Would it work for your purposes to add a Filter that just says [FieldName]="ABC" ?

khap
7 - Meteor

I have to use If statement to check condition. If (findstring(fieldname ="ABC") = 0) then "1", but it returns all. looking for an exact match.

Kenda
16 - Nebula
16 - Nebula

@khap I would recommend changing your expression to this:

 

iif([FieldName]="ABC",1,0)

This will fill in a 1 if the field is equal to "ABC" and a 0 otherwise.

khap
7 - Meteor

Thank you very much.

Dewey
5 - Atom

You could also use REGEX_match(string,pattern) for this.

 

REGEX_match([FIELDNAME],"ABC")

isaactong
5 - Atom

Hi all,

 

I have similar problem that I need to search a string in one field with an exact match of the string in another data field, however, there are many possible strings and I don't know all possible matchings. For example, find exact match of "AB" in another field ("AB", "AB1", "CD", "CD1", "EF", "EF1"), but may be "CD" or "EF" that I cannot find out all possible match strings, any command can return positive or negative of matching?  thank you for your advice in advance.

 

Labels
Top Solution Authors