Alteryx Designer Desktop Discussions

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

Convert the field to another form using trim

sriniprad08
11 - Bolide

Hi Team,

I have a column with below values.

 

Input : 000-24.00000.001-S

output : 000-24.00000.S

 

Input : 000-24.00000.001-P

output : 000-24.00000.P

 

 

please let me know how to go about it,

 

Thanks,

Sri

5 REPLIES 5
alexnajm
17 - Castor
17 - Castor

Regex_Replace([Input], "(\d{3}-\d{2}\.\d{5}\.)\d{3}-(\w)", "$1$2")

binuacs
20 - Arcturus

@sriniprad08 again regex

REGEX_Replace([Input], '(.*)\..*\-(.*)', '$1.$2')

image.png

sriniprad08
11 - Bolide

thank you @alexnajm Perfect. is it possible to replace one of the "-" with "." like in Output 2

 

Input : 000-24.00000.001-S

output 1 : 000-24.00000.S

output 2 : 000.24.00000.S

 

 

Input : 000-24.00000.001-P

output 1 : 000-24.00000.P

output 1 : 000.24.00000.P

 

thanks

sR

sriniprad08
11 - Bolide

thanks @binuacs  is it possible to do replace - with . in output 2 please?

Input : 000-24.00000.001-S

output 1 : 000-24.00000.S

output 2 : 000.24.00000.S

 

 

Input : 000-24.00000.001-P

output 1 : 000-24.00000.P

output 1 : 000.24.00000.P

 

thanks

alexnajm
17 - Castor
17 - Castor

Yes it is - see attached

 

Regex_Replace([Input], "(\d{3})-(\d{2}\.\d{5}\.)\d{3}-(\w)", "$1.$2$3")

Labels