community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Changing Single Quotes to Double Quotes in an Expression

Alteryx
Alteryx
Created on

Suppose you need to change single quotes to double quotes in an expression (i.e. write a formula in an Action, Condition, Filter, Formula, Generate Rows, Multi Field Formula, Multi Row Formula, Charting, Report Map, Table, Message, or Test tool).

 

To do this, you use the REPLACE function. This is a string function in the format:

REPLACE([FieldName], ‘x’, ‘y’)

, where ‘x’ gets replaced by ‘y’ in the ‘FieldName’ field.

 

Generally, it is not a good idea to mix single quotes with double quotes as this can sometimes produce unexpected results.

In other words, avoid using this syntax:

REPLACE([FieldName], ‘x’, “y”).

 

So you might be tempted to write your REPLACE expression like this:

 

Quotes 1.png

 

But this gives you the ‘Malformed Function Call’ error message.

At this point, you may think the double quotes need to be single quotes like this:

 

Quotes 2.png

 

But, again, you get the ‘Malformed Function Call’ message.

For this expression to work correctly, the expression shold be written like this:

 

Quotes 3.png 

 

In other words, the single quote needs to be wrapped by double quotes, and the double quote needs to be wrapped by single quotes! 

 

The example expressions in this article were produced using version 10.1 of Alteryx Designer.