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
20 - Arcturus
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
13 - Pulsar

You could also us the formula tool like so

 

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

Labels