Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

Replace formula with Wildcard

Highlighted
11 - Bolide

Hi,

 

Is there a way to do a Replace with a Wildcard?

 

Store                          to                Store

Target Store# 123                        Target

 

So it would be:  Replace([Store], "Store# {wildcard here}", "")

 

Thanks in advance for any help.

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Yes, this is possible using the RegEx version of the replace function: REGEX_Replace(. Try using this formula:

 

REGEX_Replace([Store],"\s\Store#\s\d+","")

 

RegEx breakdown:

\s = space character

\Store# = matches the string 'Store#'

\s = space again

\d = digit character (0-9)

+ = one or more (referring to the digit character)

Labels