Alteryx Designer Desktop Discussions

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

If Contains

Johmz
7 - Meteor

Hi,

 

I need help for formula or syntax on how to identify if the column2 is equal to column1 or if column1 contains of what information that i have in column2.

 

see example

 

ProfessionalPersonalStatus
Attorney John DoeJohn DoeSame Person
Engineer Jane DoeJanine DoeDifferent Person
Doctor Mark DaveMark DaveSame Person
   
   
5 REPLIES 5
usmanbashir
11 - Bolide

@Johmz - Below, to be used in Formula tool, will be able to output your [Status] Field. 

 

IF Contains([Professional], [Personal]) THEN 'Same Person'
ELSE 'Different Person'
ENDIF

 

cjaneczko
13 - Pulsar

You can use the following. 

if REGEX_Replace([Professional], '\b\w+\s([A-Z][a-z]+ [A-Z][a-z]+)\b', '$1')=[Personal] then 'Same Person' Else 'Different Person' endif

 

image.png

 

Johmz
7 - Meteor

I'm not get the correct result.Capture.PNGCapture2.PNG

Johmz
7 - Meteor

Do i need to change the Data Type?

Johmz
7 - Meteor

i got it now and do some changes. thanks for your help.

Labels