Removing partial string from data
- 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
I want to remove the text "Total" from any row that contains it in a specific field. But I want to keep any text before and after.
How can I do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @MPCNA!
This is easy with the Replace function. Add a Formula tool and use the following expression:
Replace([Field1], "Total", "")
This is saying find "Total" and replace it with nothing.
RegEx also provides a great way to solve this problem if you're interested in a simple case to learn this expression. Add this to a normal Formula tool:
REGEX_Replace([Field1], "(.*)(Total)(.*)", "$1$3")
Each set of parenthesis is a group. This expression is saying keep groups 1 and 3.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi BarnesK!
Thank you for the help! Plans changed in the few minutes since I posted. Now I am trying to figure out if there is a way to just filter out any fields that contain "Total" in them. I am trying to sum the data on Location but the "Total" fields are doubling all the sums.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @MPCNA!
That's no problem. There is actually a built-in formula for that. In a Filter tool, use a custom filter with the following expression:
Contains([Field1], "Total")
Any record that contains "Total" will come out the T side and the rest will fall out the F.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
