Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

REGEX Question

Karl_Spratt
8 - Asteroid

Hi Community,

 

I had another issue earlier and was advised to use REGEX, and honestly I'm only very, very basic on this, 

I've looked at some YouTube videos to try to learn, and I've found a funny issue, I'm using data I get form people via email, where in excel I'd use a text to columns etc. 

 

Picture below is me trying to use Regex to parse out the data, but when one Item is longer than our usual 8 digits, it's jumping over to the Sales Order Number 

We have Item Number's ranging from 3 to 15 characters (Alpha/ Numeric now a days) just to make life more difficult .

Anyway in this example more are 8 digits, but 1 is 11 characters (Alpha/ Numeric) so I'd like to understand how to build the Regex logic using this sample data, to parse all the lines correctly.

Sample Workflow You can see my bad attempt at Regex, and the sample  data in a Notepad format. 

 

I'd like in the end to see the Item Number, the Sales Order No, the current Qty, and the new (Reduced Qty) so I can learn

TIA 

Karl. 

Capture.PNG

7 REPLIES 7
apathetichell
18 - Pollux

You have your parse hardcoded for 8 digits - you can change it to any number of word characters (alphanumeric) which come before a space by starting it with:

 

(\w+)\s

 

That should extract the Sales Order Number...

MarqueeCrew
20 - Arcturus
20 - Arcturus

@Karl_Spratt 

 

Would Getword([field1],6) suffice?

 

 Cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
messi007
15 - Aurora
15 - Aurora

@Karl_Spratt,

 

In you're case you have to find the correct pattern to split the field:

 

messi007_0-1614275130146.png

Hope this helps,

Attached the workflow,

Regards,

Karl_Spratt
8 - Asteroid

Hi Messi007,

That works except for Item Number 24073256UCV it's dropping the (UCV) part of the item number.

What would you do in these  situations 

Field_1ItemSales Order NOCurrent QTYNew QTY
24073256UCV need to reduce in SO 23584456 from 29 to 2524073256235844562925

 

Regards,

Karl. 

messi007
15 - Aurora
15 - Aurora

@Karl_Spratt,

 

In this case you add an Or (|) condition

 

messi007_0-1614278153894.png

 

Attached the workflow,

 

Regards,

Karl_Spratt
8 - Asteroid

Thanks Messi007, that's amazing man...

Love to know how to do this 

 

but I'II keep trying, 

also thanks to everyone else you gave solutions. 

 

Cheers,

Karl. 

messi007
15 - Aurora
15 - Aurora

@Karl_Spratt,

 

Happy to help man 🙂 & happy analyzing.

 

Best regards,

Labels