05-26-2016 02:12 PM - edited 07-21-2021 03:15 PM
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):
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:
Interesting and very helpful. Thank you.