SOLVED
Find and replace with null fields remaining null (No data)
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
AlexL
7 - Meteor
‎07-06-2017
01:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I am looking to find and replace specific data within a field to remove trailing commas/space from a concatenation.
The Find and Replace tool in Alteryx seems to require a 2nd field to replace the data I want it to find.
I want to replace the data fields with no data to still be null.
Original-
Record ID | Data Field/Column |
1 | Refund, , , , |
2 | Refund, Credit, , , |
3 | Refund, Credit, Redeem, , |
4 | Refund, Credit, Redeem, Trade, |
5 | Refund, Credit, Redeem, Trade, Debit |
6 |
Find/ Replace-
Find | Replace |
, , , , | |
, , , | |
, , | |
, |
Desired Outcome-
Record ID | Data Field/Column | Result |
1 | Refund, , , , | Refund |
2 | Purchase, Catalog, , , | Purchase, Catalog |
3 | refund, purchase, exchange, , | refund, purchase, exchange |
4 | Refund, Credit, redeem, trade, | Refund, Credit, redeem, trade |
5 | Refund, Credit ,redeem ,trade , debit | Refund, Credit ,redeem ,trade , debit |
6 |
Solved! Go to Solution.
Labels:
- Labels:
- Parse
- Tips and Tricks
6 REPLIES 6
DanS
9 - Comet
‎07-06-2017
02:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey Alex,
Try using the RegEx Tool like this:
With this expression:
([\s\,]+$)
That should work for you.
‎07-06-2017
02:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Unfortunately, it is not working Please see image below -
DanS
9 - Comet
‎07-06-2017
06:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So sorry! Goofed at the end of the day!
Replace the capture with just a blank replacement text. Sorry about that!
suli
9 - Comet
‎07-06-2017
06:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎07-07-2017
11:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Awesome thanks!
I was able to adjust the expression to clean other fields as well!
‎07-07-2017
11:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This expression worked as well! Thanks for the reply!!!
