The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Parse everything before number?

yaser
メテオール

Hello Life savers!!

 

I have a question. I have a  column that has numbers and words and spaces. I want everything before numbers.

 

Following is how it looks like:

 

Wingate at Weston 75 Norumbega Road
E2 Franklin Square
The Blackstone 33 Blossom St
Woodsmallen shelter 794 Massachusetts Ave
Meacham St 4A
C Julius Rubin Court 6
RFD 1 BX 83 PODUNK RD

 

so I want everything before the number. for example "Wingate at Weston" form the first and so on.

 

Please help!!

 

 

6件の返信6
Thableaus
17 - Castor
17 - Castor

Hi @yaser 

 

This should work

 

Use a Formula Tool

 

Trim(REGEX_Replace([Field], "(\D+)\b\d*.*", "$1"))

 

Cheers,

ephij
コメット

Regular Expression to the rescue!  I prefer use in a formula tool

regex_replace([Field1],'^([\D]*)\d.*','$1')

 

ephij
コメット

beat me, dang it.

yaser
メテオール

NICEEEEE!!! Thanks ALotttt! 

 

Could you please explain how you created it and the logic behind it? I got so confused :'(

Thableaus
17 - Castor
17 - Castor

@yaser 

 

no problem!

 

So basically the expression captures non-digits - 1 or more times - (\D+) that come before a word delimiter (\b, which in this case, most of times, it's a space), a digit 0 or more times (\d*) - this is so the expression won't fail if there's no digit before a word delimiter, and then everything else after that is put as (.*), which it means any character 0 or more times.

 

REGEX_Replace([Field], "(\D+)\b\d*.*", "$1"))

 

You reference the captured expression in parenthesis with the "$1", which is basically what you want as an output.

 

If you wanna know more about REGEX, I recommend you taking a look at this website

https://www.rexegg.com/

 

Cheers,

 

 

yaser
メテオール

That's great!! Thanks a lot! looking at the website now!

ラベル
トップのソリューション投稿者