Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Check out our powerful new search update! You can read more here. Please let us know if you have any feedback by creating a topic here.
SOLVED

Converting number to string

Highlighted

I want to convert a number field into a string field with decimals and comma formatting. I used the "tostring([Right_sum],1,2)" formula and I get an error

 

"Error: Formula (103): The formula "Right_Sum" resulted in a string but the field is numeric. Use ToNumber(...) if this is correct. (Expression #3)"

 

Is there a way to do this with a formula and not have to also use select tools?

Meteor

Hey @spencerpoorman without seeing the workflow or a sample, I am thinking that the original field you're trying to convert is a number and that you're trying to apply the formula to the same field, which gives you an error (producing a string in a number field). My go-to fix for that is to have the conversion be a new column. Does that help?

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @spencerpoorman if you use that syntax in a existing field which is numeric you will get that error. If you create a new field in the formula tool and use that syntax and ensure you select a string field type for that new field then it will work fine.

Labels