Alteryx Designer Desktop Discussions

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

Change to numeric type

BautistaC888
8 - Asteroid

Hello,

I have a database with the following strings:
303.201,79-
I need to change them into negative Fixed Decimals:
-303201.79

 

I leave a workflow as an example. If anyone could help i will appreciate it.
Thank you.

9 REPLIES 9
atcodedog05
22 - Nova
22 - Nova

Hi @BautistaC888 

 

Here is how you can do it. I am using multi-field formula to apply on multiple columns.

Workflow:

atcodedog05_0-1628858190573.png

 

Hope this helps : )

 

Sebastiaandb
12 - Quasar

@BautistaC888 here you go, couldn't stack the multi fields tough 😞

Sebastiaandb
12 - Quasar

@atcodedog05 haha you were to fast (again ;-)) and stacked it in one tool, awesome!

apathetichell
18 - Pollux

@atcodedog05  - tonumber(regex_replace([_currentfield_],"([\d,\.]+)(-)"."$2$1")) -no?

atcodedog05
22 - Nova
22 - Nova

Hi @apathetichell 

 

There is one more catch dot should be removed and comma should be replaced with dot. I felt replace to be easier and faster to build approach 😅

Sebastiaandb
12 - Quasar

@atcodedog05 Do you know a way to stack regex formula's in the multi field tool? Would be awesome. Weird thing is that you can put multiple formula's in one formula tool after another that basically does the same for just one field, would be cool to have that functionality in the multi field tool (like first do this regex formula and then...)...

atcodedog05
22 - Nova
22 - Nova

Hi @Sebastiaandb 

 

You can nest your formulas one inside other 😅

atcodedog05_0-1628861905154.png

 

Hope this helps : )

 

Sebastiaandb
12 - Quasar

@atcodedog05  hahaha best reply i got in a long time! Awesome! Not sure if this wins any beauty competition but hey, it works :D!

apathetichell
18 - Pollux

@atcodedog05- I was going to do the much yucker

tonumber(regex_replace(regex_replace(regex_replace(REGEX_Replace([_currentfield_],"([\d,\.]+)(-)","$2$1"),"\.","|"),",","."),"\|",","))

 

 

Labels