Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Parse a string based on numbers/characters

jenner85
8 - Asteroid

Hi - I am trying to parse this (Booking Point) into just the number (Cost Center) and all text after the underscores (Description)

 

Booking PointCost CenterDescription
T__06158_BP_MBNA06158MBNA
8861_BP_GROUP SALES8861Group Sales

 

Thanks! 

4 REPLIES 4
EricaR
Alteryx Alumni (Retired)

Hi jenner85, 

 

Parsing with a regex should work.  See attached example. 

echuong1
Alteryx Alumni (Retired)

Try using regex.

 

See attached for an example.

 

echuong1_0-1600201164605.png

 

jdunkerley79
ACE Emeritus
ACE Emeritus

I would suggest a RegEx tool in Parse mode with expression:

 

.*?(\d+).*?_([^_]+)$

 

 

The number will be extracted by (\d+) and the rest after the _ by ([^_]+)

 

Sample attached

MarqueeCrew
20 - Arcturus
20 - Arcturus

@jenner85 

 

I used this expression:

 

\D*?(\d+)\D.*?_(.*)

 

It looks for non-numbers until it finds a set of numbers and then looks for the last stuff after the last underscore.

 

I put the expression into an RegEx tool (configure as parse).

 

capture.png

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels