We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

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
18 - Pollux
18 - Pollux

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

binuacs
21 - Polaris

@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
18 - Pollux
18 - Pollux

Yes it is - see attached

 

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

Labels
Top Solution Authors