Trying to remove duplicate values and trim commas in the same cell using regex replace. I am pretty close and keep trying to tweak the formula but am having no luck. Below is the current formula I am using, and the current vs desired output. I would like to use regex replace if possible as I am using this in the multi-field formula tool due to applying to many columns.
TRIM(REGEX_Replace([_CurrentField_], '(-?\d+(?:[.,]\d+)?),(?=.*\1)', ''), ',')
Below is some sample data. Cells have multiple values separated by commas.
Original Data:
0,0,67,67,0 |
-30,-30 |
0.03,0.045,0.03,0.03,0.045,0.045 |
1.17,0.37,0.36 |
1.0588,0.8125,1.3586,1.3586 |
Current output:
67,0 |
-30 |
0.03,0.045 |
1.10.37,0.36 |
1.0580.8121.3586 |
Desired output:
67,0 |
-30 |
0.03,0.045 |
1.17,0.37,0.36 |
1.0588,0.8125,1.3586 |
@lomeoari
If you dont insist on using RegEx
Thank you! I have a large dataset with many columns I need to apply this to so thinking regex might be a shorter solution.
Hi @lomeoari
Solution authors are Happy to help : )
If the solution author's response helps please don't forget to mark it as a solution.
Cheers and have a nice day!
Thanks for the response! I am applying this to a large amount of columns so I believe using regex might be an easier route.