Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

From String to Number

Cfdiaz2103
8 - Asteroid

Hi Everyone!

 

I would like to know if there's any way to convert a string data to a number, with all thousand and decimal separators

 

Example:

 

Before

1,000,500.23   (String)

 

After

1,000,500.23  (Number)

 

The main idea is summarizing some fields in excel from the output in order to validate totals, due to string data can only be counted

 

Thanks for your response.

 

 

 

24 REPLIES 24
HomesickSurfer
12 - Quasar

Hi @apathetichell 

 

I still get a conversion error with the other value using your workflow:  "ConvError: Multi-Field Formula (2): TONUMBER: 1,223,234.23 stopped converting at a comma. It might be invalid."  The multi-field tool confg'd to change output type to Double(8) results in a value of '1' 😞

Cfdiaz2103
8 - Asteroid

What is exactly the expression you use for the Multi-Field Formula?

apathetichell
18 - Pollux

I used tonumber([_currentfield_]) with the field I wanted to convert selected and the option to change it into double. It should work with the workflow I posted on friday.

Cfdiaz2103
8 - Asteroid

@apathetichell Didn't work for me.

 

Once I wrote the statement and dragged the Select Tool to convert the Sales field into a double value, I got this:

 

A Corporate 497
B Home Office 269
C Home Office 134
D Corporate 475
E Home Office 808

 

That means after running the workflow with the formula (ToNumber([Sales]), it only processed the first three characters of the string value.

apathetichell
18 - Pollux

Again - you can confirm that you aren't set up for European style "," for decimal separator - right?

 

When I run this through my workflow I can sum them as numbers and get this:

2,186,003.25

 

Also to clarify -don't use the select tool to convert to double. use the multi-field to convert. The select tool can be useful sometimes for converting integers but I would never use it to convert to double. Also - to clarify - I used the select tool in my workflow only to show you that I was taking a string and turning it into a double.

Labels