cancel
Showing results for 
Search instead for 
Did you mean: 

Parse column

SOLVED
BautistaC888
Asteroid

Parse column

Hello,
I need to parse to a column, every time a product code appear.
The product codes have this format:
SKU 0726709 ("SKU" + 7 numbers).
Here is an example.
Thank you

Attachment
Download this attachment
5 REPLIES 5
BautistaC888
Asteroid

Parse column

Hello,
I need to parse to a column, every time a product code appear.
The product codes have this format:
SKU 0726709 ("SKU" + 7 numbers).
Here is an example.
Thank you

Attachment
Download this attachment
marcusblackhill
12 - Quasar

Re: Parse column

hEY @BautistaC888 !

 

Use a formula tool with this formula below:

IIF(REGEX_Match(REGEX_Replace([Product], ".*(SKU\s*\d+).*", "$1"), "SKU\s*\d+")=-1,REGEX_Replace([Product], ".*(SKU\s*\d+).*", "$1"),Null())

 

Hope that helps!

apathetichell
Arcturus

Re: Parse column

regex parse mode - (SKU\s\d{7}) matches your  desired output.

Attachment
Download this attachment
Highlighted

Re: Parse column

Hi @marcusblackhill  - FYI - Regex_Match can return boolean values (despite what you may have heard on an otherwise wonderful Alteryx Academy video on regex) so:

 

IIF(REGEX_Match([Product], ".*SKU\s*\d{7}.*"),REGEX_Replace([Product], ".*(SKU\s*\d{7}).*", "$1"),Null())

 

is the same as yours... no reason for the unwieldy "=-1" part...

Re: Parse column

Thanks @apathetichell !

 

Actually It's just the custom to work with returns to see better the definition hehehe But yeah, don't really need that part because is boolean already.

Re: Parse column

hi @BautistaC888 

 

If unfamiliar with Regex or if challenging, a tool-based (though less-efficient) approach also works..

 

Capture.PNG

Attachment
Download this attachment