In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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