Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Converting number to string

spencerpoorman
5 - Atom

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?

2 REPLIES 2
Dan_Z
7 - 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?

JosephSerpis
17 - Castor
17 - Castor

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