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.
Hey Alex,
Try using the RegEx Tool like this:
With this expression:
([\s\,]+$)
That should work for you.
So sorry! Goofed at the end of the day!
Replace the capture with just a blank replacement text. Sorry about that!
Awesome thanks!
I was able to adjust the expression to clean other fields as well!
This expression worked as well! Thanks for the reply!!!
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |