The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more 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
binu_acs
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