Regex and ToNumber Help
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I have a string field that I am trying to convert to a value.
Current Field:
7,103,209.85 USD
-2,346,213.52 USD
Desired Output as a Number (Int)
7,103,209.85
-2,346,213.52
I'm using the following RegEx expression in the Multi-Field Formula
REGEX_REPLACE([_CurrentField_],"(\d,.+)\s(\w+)","$1")
I was expecting it to at least give me the value (7,103,209.85) but as a string (I know it won't give the value as a number b/c it doesn't recognize commas) but it's not even doing that, it's coming back with just 7 or -2. When I use the RegEx tool by itself on just one column and Parse it instead of Replace, it does correctly break it out into two columns 7,103,209.85 and USD so not sure why it won't work with Replace. I know I can use the ToNumber formula but not sure how to incorporate it with the RegEx expression. Any help would be much appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
That worked. Thank you!
