Hi,
I have some data that i am trying to categorize and i am writing a formula, but it is just not working (it is all string data). Here is the formula:
if [Service Category] = "LABO" then "Labour"
Elseif [service category] = "LSUM" and StartsWith("EDIT,", [Service Short Text]) then "Edit"
else "0"
Endif
As you can see the very final cell should read Edit but for some reason i can't get the formula to work. Am I writing something incorrect or is this not possible to write in Alteryx.
Thanks,
Krishna
Solved! Go to Solution.
I think your StartsWith code is wrong
StartsWith('ABC123', 'ABC') returns TRUE
StartsWith(String, Target, CaseInsensitive=1): Checks if a string starts with a particular string. Returns a TRUE or FALSE if the string matches the pattern. It is defaulted to case insensitive.
The Alteryx documentation use of "target" is confusing.
Here's a list of all functions:
https://help.alteryx.com/current/Reference/Functions.htm
Thanks that guide was really helpful, i amended the formula to use a Left statement and it works now!
if [Service Category] = "LABO" then "Labour"
Elseif [service category] = "LSUM" and Left([Service Short Text], 4) ="EDIT" then "Edit"
else "0"
endif
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |