Start Free Trial

Alteryx Designer Desktop Discussions

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

Convert string to number- Retain decimal with comma but change to numeric datatype.

inumidun2009
7 - Meteor

Hi All,

 

I am bringing in data from database that reads my numeric data as text

Before conversion/Raw data: 50.456.492,96 and Text Data type (V_W String or String)

 

I tried using the select tool to convert back to numeric using Double but it outputs

After conversion using Select Tool: 50.456 and Numeric Data type (Double)

 

Also I tried using Regex_Replace but I guess I'm missing an input.

 

Intended Output: 25.386.572,96 and a Numeric Data type (Double)

 

Thank you all for your help.

2 REPLIES 2
AngelosPachis
16 - Nebula

Hi @inumidun2009 ,

 

You have to remove the "." in between your digits because alteryx thinks those are decimal separators, so when you convert the value to a double, you get a different number.

 

You can use a Replace formula to achieve that. Then in your select tool, you can convert to a double, but make sure you check the the check box on the bottom left  to treat commas as decimal separators.

 

AngelosPachis_0-1611855263406.png

 

 

If you don't want to do that, you can add another expression in the formula tool, replacing the "," with a "." and then converting to a double. Both ways would work.

 

Cheers,

 

Angelos

inumidun2009
7 - Meteor

Thanks a lot, Angelos.

 

This works well.

 

Thank you for your help and diligence.

 

Kind regards.

Taiwo Adegoke.

Labels
Top Solution Authors