my field Total Opp Amount is a float type, and I'm using the formula below but getting an error. I have double checked that field exists in the dataset and the field name is spelled correctly, and that it is a float type field.
ToString([Total Opp Amount], "$0,000.00")
The error is Parse Error at char(1): Invalid type in ToDouble () (Expression #1)
I'm not using the ToDouble function so I don't understand this error or how to fix it. I've also tried converting the field to a Double type.
Can you screenshot the whole formula tool and its expressions?
Also - why Float? Double is better in this case.
@bradtukey - Try using below:
'$' + ToString([Total Opp Amount], 2, 1)
"$0,000.00" is not valid to be used in the ToString() Function
- View this Alteryx documentation on Conversion Functions - https://help.alteryx.com/current/en/designer/functions/conversion-functions.html#idm45832346081648 . ToString() is at the very bottom.
Hope this helps!
Thank you, that worked, but only if I first converted the field to V-String. When I ran your formula with the field as "double" I got an error that said the field has to be a string. converting the field back to numerical after adding the "$" resulted in Null values in the field. What I'm trying to accomplish is to export my table to Excel, and when I open the workbook, have the field already formatted as currency.
For this, you'll need to use the reporting tools. A table and render tool will do this. Alternatively, you can export to an Excel sheet for "data" and use formulas to read and format the data in another tab if you want to avoid the reporting tools.