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

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Announcement | We'll be doing maintenance between 9am-11am MT on Saturday, January 15th, which may impact your experience. Thanks for your patience as we work on improving the community!
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?

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