Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How do I extract $value without the $ sign into a new field?

AlYap
7 - Meteor

Hi, 

 

I am trying to extract the numbers only from a field of strings. Example below:

 

Project Total- $463.2MM. Approved

RT:$134.0MM but current pending review.

Approved total - $198,336,058, routed for PO.

 

Expected output:

463.2

134.0 

198.3

 

Is there a way I can do this based on the variability of some numbers shown in MM, and some in the full value? Otherwise can someone help how I can just extract the value after the "$" sign? Any help welcome. 

5 REPLIES 5
Qiu
21 - Polaris
21 - Polaris

@AlYap 

I tried with RegEx and hope this is what you need.

Capture1.PNG

mpennington
11 - Bolide

My formula was a bit different, but I got it to work as well. Probably should have wrapped this in a Tonumber, as @Qiu did.  

 

IIF(REGEX_Match([Field1], '.*\$(\d+),(\d)\d+,.*'), REGEX_Replace([Field1], '.*\$(\d+),(\d)\d+,.*', '$1\.$2'), REGEX_Replace([Field1], ".*\$(\d+\.\d)MM.*", "$1"))

 

Edit: Couldn't help myself, here is the Tonumber formula:

 

TONUMBER(IIF(REGEX_Match([Field1], '.*\$(\d+),(\d)\d+,.*'), REGEX_Replace([Field1], '.*\$(\d+),(\d)\d+,.*', '$1\.$2'), REGEX_Replace([Field1], ".*\$(\d+\.\d)MM.*", "$1")))

 

Match.png

AlYap
7 - Meteor

Wow. Thank you so much @Qiu. This works! 

Qiu
21 - Polaris
21 - Polaris

@AlYap 
Glad to help and thank you for the accept mark.

AlYap
7 - Meteor

.@Qiu was wondering if you may be able to help with another of my query here.

Labels
Top Solution Authors