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

Parsing after a word

NikitaShetty
5 - Atom

Hi, 

 

I'm trying to use the RegEx function to parse the data after the word 'DIS T' so that I can then use the space delimiter to break this down into separate columns. 

 

nshetty_1-1596058838512.png

 

Could someone please help me with this? I have tried 20 odd functions but I'm unable to figure this out.

Thanks!

 

7 REPLIES 7
DavidP
17 - Castor
17 - Castor

How about this in Regex parse mode

 

.+DIS T\s+(.+)\s+(.+)\s+(.+)

NikitaShetty
5 - Atom

Hi David, 

 

That works partially, the first set of digits (30.00) gets tagged to the 8.99- in the same column and then I get the last set separately (20.99):

 

nshetty_0-1596065326952.png

 

How can I tweak the expression to get the middle '8.99-' in the separate column? 

 

Thanks!

DavidP
17 - Castor
17 - Castor

Try this

 

.+DIS T\s+([\d\.-]+)\s+([\d\.-]+)\s+([\d\.-]+)

 

DavidP_0-1596065476971.png

 

NikitaShetty
5 - Atom

Hi David, 

 

Thanks a mil - This works like a charm!

 

Could you just let me know what the expression actually translates too? It might help me to figure out solutions in the future!

DavidP
17 - Castor
17 - Castor

I'll break it down from left to right:

 

some stuff:         .+   

followed by:        DIS T 

followed by a space or more:      \s+

followed by a set that consists of numbers and/or dots and/or minuses:   ([\d\.-]+)

followed by a space or more:      \s+

followed by a set that consists of numbers and/or dots and/or minuses:   ([\d\.-]+)

followed by a space or more:      \s+

followed by a set that consists of numbers and/or dots and/or minuses:   ([\d\.-]+)

 

The 3 sets of () define the 3 columns you're looking to parse the data to.

 

Hope this makes sense.

NikitaShetty
5 - Atom

That's perfect, thanks David! Also, I realised you were training us for alteryx today (PwC). Funny coincidence 🙂

DavidP
17 - Castor
17 - Castor

@NikitaShetty, that is such a funny coincidence!

Labels