In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more 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
19 - Altair
19 - Altair

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

binu_acs
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 @binu_acs  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
19 - Altair
19 - Altair

Yes it is - see attached

 

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

Labels
Top Solution Authors