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

Alteryx designer Discussions

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

Converting String to Number

Why when converting my Discount and my Net Payment From Payment Request columns from String to Number then cells go to 0.00?

Please ignore/delete the vlookup

This is because of the leading $ sign.

 

The easiest change is to use a multi field formula tool to remove these.

 

ToNumber(Regex_replace(Regex_replace([_CurrentField_],'[,$ ]',''),"\(([0-9\.]+)\)","-$1"))

Should parse all your fields 

Alteryx Partner

You need to use a multi-field formula to remove these characters :   $ and , and ( and ) and when removing the brackets make sure it's a negative number.

 

This code will do it:

 

replace(
replace(
replace(
replace([_CurrentField_],"$","")
,",","")
,"(","-")
,")","")

2018-12-07 06_53_34-Alteryx Designer x64 - Conversion Error.yxmd_.png

Alteryx
Alteryx

I'm late to the party on uploading this, but its the $ and ,'s in the numbers.

 

The attached fixes it.

Labels