In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Get last 4 digits of a string

wonka1234
10 - Fireball

Hi,

 

What formula can I use to extract the last 4 digits of  a string?

 

2 REPLIES 2
AngelosPachis
16 - Nebula

@wonka1234  can you provide an example of how your string looks like?

 

The simplest way would be Right([your string field],4) that will get you the 4 last characters.

 

If you want those to be digits, you can use a RegEx tool set to parse the string with the following expression

.*(\d{4})
Lunamoona0
5 - Atom

The formula =RIGHT(A2,LEN(A2)-4) in cell B2 is used for removing the last 4 digits of numbers in the product code.

Labels
Top Solution Authors