Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Find a case sensitive string from a multi value concatenated string

bobbybalan
7 - Meteor

Hello, How can I match a string in a concatenated string of values. For example CONCAT_STRING = '009', 'G56', 'w34'. If there is a match (case sensitive) with FIELD1 then set variable RESULT = 'Y'.

If FIELD1 =  'G56' then RESULT = 'Y'. If FIELD1 = 'g56' then RESULT = 'N'. 

 

I tried doing this - REGEX_Match([FIELD1], [CONCAT_STRING] , 0) but doesn't seem to work. How do I do a case sensitive match and assign the RESULT value based on match or non-match.

 

Thank you!

2 REPLIES 2
kathleenmonks
Alteryx
Alteryx

Hi @bobbybalan,

 

The result will be -1 if the REGEX_Match is true, so you can change your formula to an if/else statement to get the result to be 'Y' or 'N' like this:

 

IF REGEX_Match([FIELD1], [CONCAT_STRING] , 0)
THEN "Y"
ELSE "N"
ENDIF

kathleenmonks
Alteryx
Alteryx

And @bobbybalan, if the CONCAT_STRING field has multiple values in it, then you could change it from regex_match to a "contains" function like so:

 

if Contains([CONCAT_STRING], [FIELD1],0)
THEN "Y"
Else "N"
ENDIF

Labels