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

Replace text before a string

Mancunian
8 - Asteroid

I have values in a column that read  NS50367 Base and 56789 Case 2.

How do I get the values to only be Base and Case? The numbers and later before base and case will always change. Base and Case will always remain the same.

3 REPLIES 3
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @Mancunian,

 

You could use: REGEX_Replace([Value], '.*(Base|Case).*', '$1')

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Regards,

Jonathan

Mancunian
8 - Asteroid

I should have been more specific. My values are actually this 

10201 Base Case
5337 Case 2 - 12position
Ns5337 Case 3 - Increase Size

 

How do I get these to only remove the prefixes before Base and Case. So that I get the following.

 

Base Case
Case 2 - 12position
Case 3 - Increase Size
Jonathan-Sherman
15 - Aurora
15 - Aurora

I see! In that case you could use REGEX_Replace([Value], '.*?((?:Base|Case).*)', '$1')

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Regards,

Jonathan

Labels
Top Solution Authors