Alteryx Designer Desktop Discussions

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

How to filter/extract random position 3 numbers in string?

Jun4Ariat
5 - Atom

I need some help with the data below.  I need to extract only the 3 digits from the Merchant Reference column and have the result show in a separate new column (I listed the Result column I want to get).  Some of the rows do not contain the 3 digits , which is ok , they can just be blank.

I am totally new to Alteryx and this one is totally beyond me.  Help please!

Merchant ReferenceResult column
14295001898-evelynfigueroa-102lex102
MarisaThompsonPFG106106
PHX204 Francisco Gallegos204
PHX204 Cid Esperanza204
Amanda Sobi106PFG106
Teresa Aguilar  Lehi 203203
Kara Guerin- 14286001496- 103NAS103
Scrub Top-10039713 (LG) 
Arthur Cuevas Lehi 203203
13774004977-MickeyParis 
14288002080 Kaci Anderson 102LEX102
14279000825-CorbinSweatt 
Lynwood Knowles 104OCA104
Brian Williams 106 PFG106
13766011042-201Gil Haylee Griffith201
101-CaitlinFaust-10035836101
5 REPLIES 5
geraldo
13 - Pulsar

@Jun4Ariat 

 

Below is a workflow with regex examples to extract the new column

Jun4Ariat
5 - Atom

Thank you so much @geraldo!  This works perfectly!

Jun4Ariat
5 - Atom

@geraldo, for some reason, these 3 scenarios do not work with this solution ... can you help me again please?  all those 3 digits 204, 101 and 202 should be extracted. thanks!

 

Sue Ludwig 204-PHX
101 Carol Cortez 10048260
14279000929 (202sawgrass)

geraldo
13 - Pulsar

@Jun4Ariat 

 

Replaces the regex tool with these expressions.
^\d{3}-|^\d{3}\s|-\d{3}[a-z]|\s\d{3}[a-z]|[a-z]\d{3}|\s\d{3}\n|\s\d{3}\s|\s\d{3}$|\s\d{3}-|\(\d{3}
and check if it meets the new texts. I'll look for a pattern that fits all cases and send it to you.

Jun4Ariat
5 - Atom

This solved the issue, thank you so so much!

Labels