Calling all Alteryx customers: Refer your colleague to try Alteryx and receive a $50 gift card. Sign up now!
Free Trial

General Discussions

Discuss any topics that are not product-specific here.
SOLVED

Replace Tool - How it works?

selinunlu
7 - Meteor

Hello there is three type of units in the same column. I want to replace all three wih one unit named "adet"

 

1 pcs

1 month

1 l

I want them to be like " 1 adet " 

 

I tried replace formula but I only can do for one of them. How can I use collective formula?

Thanks in advance.

selinunlu_0-1647450455585.png

 

6 REPLIES 6
JarekSkudrzyk
11 - Bolide

@selinunlu 

Hi,

I am not sure if I understood you correctly - you wish to replace all the unit names (e.g. "pcs", "l", "months") with "adet"?
You can try using regex replace - please find solution attached.

Please let me know if this helps.

JarekSkudrzyk_0-1647464186498.png

 

JarekSkudrzyk
11 - Bolide

You can use REGEX_replace formula in the formula tool with similar effect:

REGEX_Replace([Quantity], "\s([a-zA-Z]+)", " adet")

 

Qiu
21 - Polaris
21 - Polaris

@selinunlu 
We can try the Find and Replace tool.

It requires a input file but it will be easy to maintain for any future change without modifying the coding.

0317-selinunlu.PNG0317-selinunlu-1.PNG

selinunlu
7 - Meteor

Thank you so much. It worked! but I don't get "regular expression" expression. \s([a-zA-Z]+) what these characters? :) 

 

 

Qiu
21 - Polaris
21 - Polaris

@selinunlu 
You can use this site to test you RegEx and also it gives detailed explanation.

https://regex101.com/

Capture12.PNG

JarekSkudrzyk
11 - Bolide

@selinunlu 

you are welcome:)

please note that the RegEx is something that is quite widespread (i.e. present not only in Alteryx) so I really recommend learning it.

Plus it can really speed up text parsing activities (in some cases) in comparison to using regular formulas.
The website linked to by @Qiu is a great one - I also use it myself.

Labels
Top Solution Authors