community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Regex Parse Help

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?

Asteroid

You can use Text to Columns tool to accomplish this

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