Learn more about the Alteryx Maveryx Universe recently announced at Inspire 2023!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Concatenating and adding (integer) fields

HenrietteH
Alteryx
Alteryx
Created

In Alteryx, the + (plus) symbol has different functionalities depending on if you are using text (string) or numeric fields.

If you use + with text fields, it will concatenate them, e.g. "Mary had" + " a little lamb" -> "Mary had a little lamb"

If you use + with numeric fields, it will add them, e.g. 1+2 = 3

What if you want to concatenate your numeric fields? If you convert them to string fields first, Alteryx will concatenate instead of add. To convert to a string field, us the tostring() function.

This example illustrates the difference between concatenating and adding for numeric fields (NOTE: NumbersCombined is a string field, NumbersAdded is an integer):

concatimage.png

The tostring() function also lets you format your data by defining the number of decimal places and adding comma separators if needed.

E.g. tostring([Sales],2,1) converts the double to a string keeping 2 decimal places and adding commas for easy readability:

concatworkflow.png

Comments
mvtejano
7 - Meteor

Interesting and very helpful. Thank you.