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

5 REPLIES 5
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")

Labels