Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Converting text to number (from European to American decimal system)

GaRaGe
アステロイド

I have a data set with a character field which has basically numbers in European decimal convention (E.g. "2.567,834", "88.212,091"). I need to convert this field to numeric and also change the decimal convention to the American format (E.g. 2567.834, 88212.091). 

 

Is there a way to do it in Alteryx?

2件の返信2
DataBlender
ボリード

Hi @GaRaGe, you'll need to use the Replace function in the formula tool to replace '.' with nothing and then commas with a decimal point:

 

Replace(Replace([Field],".",""),",",".")

 

Then you can add a select after and change to a numerical datatype.

 

 

Niekka
メテオロイド

Hi GaRaGe,

 

A quick and dirty way of doing it would be in a Formula tool, just update the [Number] field as such: ReplaceChar(ReplaceChar([Number],".",""),",",".")

This will result in a string, if you need it to be a number in your local settings just add ToNumber() to the whole string. (mine is European so that would just revert back to original string)

 

Hope this helps

 

//Anders

投票
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
ラベル