What does this error mean? How do I fix it?
Solved! Go to Solution.
Hi,
I think you miss ) after the contains function.
HI @Kwaku_Od - that error means the syntax of one of your expressions is incorrect.
For your specific case, the syntax would be
If Contains([State], " Virginia")
etc.
with a closing parenthesis after the string you're checking for in the [State] field.
Thank you! It worked. Is there a way to change smart quotes to straight ones after you have entered the text?
Do you mean in the data field? That would be as follows (for closing smart quotes):
Replace([field], ' ” ', ' " ')
You'd need to make a second expression for the opening smart quotes.
If instead you mean within the expression editor itself, the quickest way is to edit the XML of the workflow itself. Open the workflow file in a text editor to expose the raw XML directly, then do a find-replace in there. While it's not likely that smart quotes exist anywhere else in the XML as part of a tag, you'll still want to be careful about examining each "hit" on a smart quote lands on to verify that it's part of your expression and not part of the XML itself.
You'll need an ELSEIF keyword.
Check out the syntax at https://help.alteryx.com/20213/designer/conditional-functions
More specifically:
IF c THEN t ELSEIF c2 THEN t2 ELSE f ENDIF
Thank you!
Hi @Kwaku_Od
I know this usecase has been already solved. Here is my take on it, looking at the very lengthy list of state names its best suitable to use find and replace tool.
Workflow:
Advantage: It's easy to maintain and update the list.
Resource on Find and Replace tool: https://community.alteryx.com/t5/Interactive-Lessons/VLookUps-with-Designer/ta-p/80201
Hope this helps : )