Hi,
I am trying to figure out why my formula doesnt work,
How come this doesnt work
Contains(Replace(Replace([N_VALUE],"SECURITY ROLE", ""), "SECURITY", "")) or
Contains(Replace(Replace([N_VALUE],"SECURITY GROUP", ""), "SECURITY", ""))
Then "Yes"
Solved! Go to Solution.
Hey @wonka1234,
If you look at the contains function in the docs: String Functions | Alteryx Help It requires two parameters:
One the string you are looking at
Two the string you are looking for
You have only given it the first part you need to add a comma and say what your looking for. Also an IF statement needs an IF an ELSE and an ENDIF.
The community has some quick and easy videos on formulas and the Formula Tool here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Writing%20...
You could write your formula like this for instance:
IF
Contains(Replace(Replace([N_VALUE],"SECURITY ROLE", ""), "SECURITY", ""), "Example") or
Contains(Replace(Replace([N_VALUE],"SECURITY GROUP", ""), "SECURITY", ""), "Example")
Then "Yes"
ELSE
"No"
ENDIF
Any questions or issues please ask
Ira Watt
Technical Consultant
Watt@Bulien.com
Hi @wonka1234
Perhaps you can share what you're trying to accomplish (sample data > expected result). A few quick observations:
A more complete formula might be something like this (you'll have to fill in the big red questions):
IF Contains(Replace(Replace([N_VALUE],"SECURITY ROLE", ""), "SECURITY", ""),'CONTAINS WHAT?')
or Contains(Replace(Replace([N_VALUE],"SECURITY GROUP", ""), "SECURITY", ""),'CONTAINS WHAT?')
Then "Yes"
Else 'ELSE WHAT?'
endif