I have a nested if statement which has been working fine for months in the 2021.4 version of the Designer. On my new laptop I installed 2022.1 and this version is showing an error.
The formula I have is:
if contains([Candidate Name],"(internal)",1) then "Internal"
else if contains([Candidate Name],"(prior worker)",1) then "Prior worker"
else if contains([Candidate Name],"(referral)",1) then "Referral"
else ""
endif
endif
endif
The error message is:
Error: Formula (137): Parse Error at char(144): Formula: tried to apply string operator to numeric value (Contains) (Expression #1)
Solved! Go to Solution.
Hey @rslotemaker,
The data type of your Candidate Name column must be numeric not text. Put on a select tool before the formula tool and change the type of Candidate Name to VString.
I have attached an example.
You can find some good quick videos on how data types work here on the community https://community.alteryx.com/t5/Interactive-Lessons/Understanding-Data-Types/ta-p/73958
@IraWatt thanks for your help. Since it worked fine in the older version of Designer, I hadn't realized the data type from the input was set to Double instead of string. I've changed that and now it works fine!