Alteryx Designer Desktop Discussions

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

Contains in IF formula

bogdansheremeta
7 - Meteor

Currently, I have a formula that says IIF(Contains([Data],"Secured"),"Yes","No"). However, this also picks up the word "Unsecured", but I only need it to pick up the word Secured. Is there a different way to structure this formula so that the word "Unsecured" does not become a "Yes"?

4 REPLIES 4
DataNath
17 - Castor

Because secured is within unsecured, this satisfies your statement that [Data] field contains secured. If you just want it to outright check for secured without any extra possibilities then just use IIF([Data]="Secured","Yes","No").

Hi @bogdansheremeta 

 

Do you have to use contains? I'm asking because you can say [Data] = "Secured". TY!

Reddy4
7 - Meteor

Try this formula

IIF(Contains([Data],"Secured", 0),"Yes","No")

This makes the search word case sensitive and should work if you have unsecured as 'Unsecured' and secured as 'Secured'.

Just to add, if it's within a longer text, you can try to add a space so it says contains([Data]," Secured"). There is here a space before Secured  to make sure words like Unsecured don't get selected.

Labels