We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Remove last 2 digit from the column

nayrah
5 - Atom

Hi  All

 

Can you pls advise how to remove the last two characters from this no

 

Example:

 

ABC0000005709859-2

 

i have to remove - and numbers appear as last

 

kindly advise ,thanks in advance

 

 

 

3 REPLIES 3
binuacs
21 - Polaris
ShankerV
17 - Castor

Hi @nayrah 

 

One way of doing this is with the help of Regex tool.

 

Regular expression

(\d+)(-\d+)

 

Output method: Replace

Replacement Text: $1

 

Note: By using this method, it will help to trim the last 2 digits only when it contains '-'

 

Many thanks

Shanker V

aatalai
15 - Aurora

You could also us the formula tool like so

 

Left([Data], Length([Data])-2)

Labels
Top Solution Authors