My sets of data contains:-
ABC_DE_12345_678 |
ABC_12345_678 |
ABC |
ABC_12345 |
I want to remove the end of the letter so that the column will become the following results
ABC_DE |
ABC |
ABC |
ABC |
How do i write a if statement say if its detect its a digit at the end of the row, it will automatically remove the digit with the underscore?
Hi @terrellchong ,
is there any reason you would want to use an IF statement?
I've attached a workflow which does this in Regex:
What this is doing is saying remove all numbers, and where this an underscore followed by a number, and a number followed by an underscore.
This will give you the results you need in this example.
Hope this helps,
M.
This is a great use-case for regex_replace. You can use a formula like below to replace underscore(_), followed by numbers(\d) and any characters(.*) to blank.
REGEX_Replace([Input], "_\d.*", "")
Workflow:
Hope this helps 🙂