Hello everyone!
I have the following problem:
I need to delete the last number after "-" only if it's equal to 301
For example
222-444-301 | 222-444 |
222-444-555 | 222-444-555 |
Thanks!
Solved! Go to Solution.
trimright([field],"-301")
Ben
It doesn't work
input | output |
5587-838384-223 | 5587-838384-22 |
555-33-331 | 555 |
I'm not sure what is going on with that statement...
This one definitely does.
if right([input],3) = "301" then Left([input],Length([input])-4) else [input] endif
Okay so it looks like the trimright([field],"-301") function was looking for any of the characters in -301 at the end of the string and replacing them with nothing; I thought it would do the entire string only.
Anyway, the second solution I have provided should be adequate!
Always learning!
sorry for poor data. There can be any length of the row.
Let me show some more examples
Input | Output |
388-999-333-301 | 388-999-333 |
565-333-301-555-301 | 565-333-301-555 |
388-888-301-301 | 388-888-301 |
Did you try the sample?
Just plug the data into the workflow. and run