Alteryx Designer Desktop Discussions

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

Regex_Match

BRRLL99
11 - Bolide

I have following scenario 
Scenario : 1
Input:

data
NRFB MC Pres 0704
DEBIT
CREDIT
NRFBMCPres7/4/2024
MCPres-07/04/2025
MC Pres001
$$mc Pres 7/01
MC$Pres$ 001

 

Expected output:  whenever there is MC Pres in the data with any combination it should be shown in separate column

data 
NRFB MC Pres 0704MC Pres
DEBIT 
CREDIT 
NRFBMCPres7/4/2024MC Pres
MCPres-07/04/2025MC Pres
MC Pres001MC Pres
$$mc Pres 7/01MC Pres
MC$Pres$ 001MC Pres



Scenario 2 :

DATA
MC Prsntmnts 0704
NRFB MC Prsntmnts0704
RBmcPrsntmnts9/4/24
$Prsntmnts--07/04
MCPrsntmnts

 

Expected Output


DATA 
MC Prsntmnts 0704Prsntmnts
NRFB MC Prsntmnts0704Prsntmnts
RBmcPrsntmnts9/4/24Prsntmnts
$Prsntmnts--07/04Prsntmnts
MCPrsntmntsPrsntmnts

 

 

Scenario : 3

data
121324
14312425256
52352352456
RRB
52345234
GL CONTRA 091012
45363
FB092210

 

Expected Output: whenever the row starts with String then number from row should be extracted

data 
121324 
14312425256 
52352352456 
RRB 
52345234 
GL CONTRA 09101291012
45363 
FB09221092210


Note: All scenarios are different required output using different formulas for each

2 REPLIES 2
Deano478
12 - Quasar

@BRRLL99 Give us a look at what formula(s) you have tried so far

KGT
12 - Quasar

You can try it in different formulas, but your data is a little messy. There is an "MC Pres" flagged in your sample that is actually "MCPres". For the first 2 use cases, I wouldn't use REGEX as it's simpler in a lookup table that you can keep adding to.

 

The 3rd though, is easier with REGEX. The formula I used will take all digits at the end of the string if the first character is from A-z: [A-z].*?(\d*)$

If you want to test a few, then go to regex101 or regexpal and put your sample data in then test a few variations of that if you want something slightly different.

 

 

AlteryxGui_fLhirXGuuG.png

Labels
Top Solution Authors