Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Returning Values that have numbers in it

sachinhejeebu
6 - Meteoroid

Hello! 


I am using REGEX_Match to try and return values that have numbers in it. I'm using the formula: "IF REGEX_Match([Field 1], ".*\d+.*")=-1 THEN [Field 1] ELSE Null() ENDIF". 

 

I want the formula to return values even if it has a letter in the field. For example (0124AC243).

 

For some fields it is returning the values, but others that have letters at the end it isn't recognizing the numbers in it. Any suggestions? 

 

Example of cells that aren't returning: 

00002418MXF

 

Cells that are returning: 

R21751076

7 REPLIES 7
Bren_Spill
12 - Quasar
12 - Quasar

@sachinhejeebu - it seems to be working correctly when I run the data you have provided. Can you attach a sample workflow containing your error?

 

image.png

cjaneczko
13 - Pulsar

Formula seems to be ok.

 

IF REGEX_Match([Field1], ".*\d+.*")=-1 THEN [Field1] ELSE Null() ENDIF

 

image.png

OTrieger
12 - Quasar

@sachinhejeebu  your formula is working for me.f.PNG

OTrieger
12 - Quasar

Not sure what you are facing, however if you will share some snippets we could check it, however everything seems to be fine

TUSHAR050392
11 - Bolide

Hey @sachinhejeebu Try this if this works-

 

IF REGEX_Match([Field 1], ".*[a-zA-Z].*") = -1 THEN [Field 1] ELSE Null() ENDIF

sachinhejeebu
6 - Meteoroid

I'll need to scrub the original workflow for sensitive information but here is an example

 

We're using the Text to Columns to split via a deliminator, then scanning it for an "Invoice Number" essentially. In theory, Row 2 and 3 should both have values in New_Description2. 

 

Thanks for the help! I'll also try the A-zAZ formula

Bren_Spill
12 - Quasar
12 - Quasar

@sachinhejeebu - in your screen shot attached the * is missing from the regex_match formula

 

image.png

 

Labels
Top Solution Authors