Alteryx Designer Desktop Discussions

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

Malformed Function Call

Kwaku_Od
7 - Meteor

What does this error mean? How do I fix it?

8 REPLIES 8
Emil_Kos
17 - Castor
17 - Castor

Hi,

 

I think you miss ) after the contains function.

Scott_Snowman
10 - Fireball

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.

Kwaku_Od
7 - Meteor

Thank you! It worked. Is there a way to change smart quotes to straight ones after you have entered the text?

Scott_Snowman
10 - Fireball

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.

Kwaku_Od
7 - Meteor

I put in the brackets but I'm getting an if error code. doesn't else come after the if in the if- function chain?

Scott_Snowman
10 - Fireball

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
Kwaku_Od
7 - Meteor

Thank you!

atcodedog05
22 - Nova
22 - Nova

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:

atcodedog05_1-1630997636482.png

 

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 : )

Labels