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 Parse Help

al_sweets
8 - Asteroid

I have some data which contains a field I would like to use to Parse Regex tool on but I can't quite figure it out. The column I am looking at parsing looks as follows:

 

Business
[["Services","Printing"]]
[["Sports and Leisure","Outdoors","Camping"]]
[["Retail","Fashion","Watches"]]
[["Services","Financial"]]

 

There are 800,000+ rows, so there are numerous combinations. I would like to separate these tags into separate fields, like follows.

 

BusinessCat1Cat2Cat3
[["Services","Printing"]]ServicesPrinting[Null]
[["Sports and Leisure","Outdoors","Camping"]]Sports and LeisureOutdoorsCamping
[["Retail","Fashion","Watches"]]RetailFashionWatches
[["Services","Financial"]]

Services

Financial[Null]

 

Does anyone know the Regex pattern to parse this like above?

2 REPLIES 2
rarmstrong
8 - Asteroid

You can use Text to Columns tool to accomplish this

neilgallen
12 - Quasar

@al_sweets The solution above would work, but that presumes that you know the maximum number of values that will be in each field. in case you're not sure (and with 800,000 values I'm not confident you would be) then the attached solution would work.

 

Parse.PNG

 

Parsing to rows allows for a variable field length. The attached workflow would account for this. 

 

To answer your earlier question, a regex could be used, but isn't necessary.

Labels