Free Trial

Alteryx Designer Desktop Discussions

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

Keep the string after the _ (Trim / Regex)

AJ-Fahmy
5 - Atom

I have a dataset that is like this:

 

Name
Instruments_Base__c
Cross_Selection_HR__c
CrossSelection_Base__c
VPN_Instruments_HR__c
T_and_S_Base__c
T_and_S_HR__c
VHS_3D_Recreation_Base__c
VHS_3D_Recreation_HR__c
Theoretical_Base__c
Theoretical_Products_HR__c

 

I only want to keep Base__c and HR__C ( that is Base Underscore Underscore C or HR Underscore Underscore C).

I'm not great when it comes to working with RegEx, so any help would be great.

Thanks

6 REPLIES 6
MarqueeCrew
20 - Arcturus
20 - Arcturus

@AJ-Fahmy ,

 

a pattern looking for it might be:

 

REGEX_Replace([field],".•_(\w+__\w)",'$1')

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Thableaus
17 - Castor
17 - Castor

Hi @AJ-Fahmy 

 

If you use a filter tool you might use this regex:

 

Thableaus_0-1593919445750.png

 

 

Cheers,

AbhilashR
15 - Aurora
15 - Aurora

Hi @AJ-Fahmy, assuming you are always only looking for Base__c or HR__c, you could use the following logic:

(Base__c|HR__c)

 AbhilashR_1-1593919458854.png

I have attached a sample workflow to help better understand my approach. Hope this helps!

MarqueeCrew
20 - Arcturus
20 - Arcturus

Faster @AJ-Fahmy  would be:

 

IIF(Right([field],7)="Base__c","Base__c","HR__c")

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
AJ-Fahmy
5 - Atom

Awesome, yep, this is what I was looking for. Thank you @ , for your help

AJ-Fahmy
5 - Atom

Awesome, yep, this is what I was looking for. Thank you @ for your help

Labels
Top Solution Authors