Trying to replace the last part of this string after the comma(XYZZA) only in cases where it doesnt end with '_General'
FY18,Other Customer,XYZZA
FY18,Other Customer,ABC_General
Current regex is below but it doesnt work as it looks for any of the letters in general, not the entire word.
,([^(_General)]+)$
Just cant seem to figure out how to use [^] condition for an entire word.
Thanks!
Solved! Go to Solution.
Hi @brindhan
Solution is attached.
By first using a REGEX_MATCH formula, we can determine whether the string ends with '_General' and take steps from there. As per the logic, if the string ends in 'General' then we will keep as is. Otherwise, remove the last part of the string after the comma. The below formula will get this done:
if regex_match([Field1], '^.*_General$') then [Field1]
else regex_replace([Field1], '(.*,).*', '$1')
endif
Hope this helps!
This is awesome, thanks @lmorrell !
User | Count |
---|---|
19 | |
15 | |
15 | |
9 | |
8 |