Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Regex Help

cchannyyy
5 - Atom
Hi Community,
 
I'm trying to use Regex to grab the third to last entity "P1DX68N". What would be the regex formula?
 
This is the following placement:
 
AFR_2020_aw_US_CADREON_pmp_PKG_crossdev_multi_rot_na_Audio Package_audio_audio_NA_NA_nonskip_CPM_SS_EN_C20AFR00US_P1DX68N_9/17/2020_11/1/2020
 
Best,
3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @cchannyyy ,

 

You extract that by using this formula in formula tool

 

Right(left([Field1],Length([Field1])-20), 7)

 

Output:

atcodedog05_0-1602003421723.png

Workflow:

atcodedog05_1-1602003441094.png

 

Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

 

jdunkerley79
ACE Emeritus
ACE Emeritus

Hi,

 

I suggest:

REGEX_Replace([Field1], "^.*_([^_]+)_[^_]*_[^_]*$","$1")

This will pick the 3rd from the last block surrounded by '_' 

 

Quick sample attached.

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @cchannyyy 

 

Cheers and happy analyzing 😀

Labels