Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

remove everything after '_' character

Sshasnk
8 - Asteroid

Hi,

I have a dataset and I have to remove everything affter '_'

 

namelast namecode
abcdef

MQ_ALs_234589

KJFKLJ

ERT_Alte_kjm56

FGHLKJH#3_LKJ
MKJHKL456_KL_MKL_KL

 

Output:

 

namelast namecode
abcdef

MQ

KJFKLJ

ERT

FGHLKJH#3
MKJHKL456

 

 

3 REPLIES 3
binuacs
21 - Polaris

@Sshasnk This can be done with the help of the substring function

binuacs_0-1664284028690.png

 

davidskaife
14 - Magnetar

Hi @Sshasnk 

 

Here is a quick way of doing it, as long as you always want the data prior to the first _

 

DavidSkaife_0-1664284146208.png

 

Emmanuel_G
13 - Pulsar

@Sshasnk 

 

Find attached the way of doing this using Replace_first function.

 

Please do not hesitate to mark this answer as solution if it helped.

 

Emmanuel_G_0-1664284920116.png

 

Labels
Top Solution Authors