Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Find String in field extract certain number of characters after it

Inactive User
Not applicable

So here is the scenario I have a field that cantains a series of text and numbers, clearly its a string field. within this field there may appear the word LOAN # or Loan NO or even Just Loan: typically after this there will be a 10 digit number. My goal is to extract the number that follows.If I could simply extract the number and perhaps any characters that come between the word Loan and the ten digit number, then I could clean that new field to contain just numbers and Im golden. I have figured out how to identify if the word Loan appears in the field, I just cant figure out the rest. the difficulty with this is that the word loan and the loan number do not fall in the same place in the field, if they are there at all. The field where this string is is called 'Comment 03' the field where I would like to move the loan number to is called 'LoanNumber'

3 REPLIES 3
Qiu
20 - Arcturus
20 - Arcturus

@Inactive User 
I prepared some dummy data as per your description.

If you could provide some sample data, that will help to improve.

1212-DJLemons.PNG

Inactive User
Not applicable

This worked for me but can you explain what its doing? Im not sure I understand the expression and how the parts are working.

Qiu
20 - Arcturus
20 - Arcturus

@Inactive User 

.*(?i)LOAN.*?(\d{10}).*

The .*  means zero or more characters, and (?i) flags case-insensitive, so it will work for both "LOAD" or "load".

So totally, zero or more characters before and after "LOAN", then follows 10 digit numberbs, then zero or more characters.

You may find this website very useful.

https://regex101.com/

Labels