Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
Register for the upcoming Live Community Q&A Session - and don't forget to submit your questions for @DeanS regarding the future role of analytics here.
SOLVED

Text to columns with specific no. of words in phrase

Highlighted
6 - Meteoroid

Hi,

 

I wish to turn below input data to the CSV/tab delimited form as mentioned under output. Issue is that Campaign name is not fixed size(words).

 

<input data>

Marketing Campaign Name

Email List Subscribers Jan 2020

Beauty Customers Feb 2020

Spring Sale March 2020

Product Category Campaign April 2020

Loyal Customer Campaign May 2020

Summer Sunshine June 2020

 

<output data>

 

Marketing Campaign Title

Month

Year

Email List Subscribers

Jan

2020

Beauty Customers

Feb

2020

Spring Sale

March

2020

Product Category Campaign

April

2020

Loyal Customer Campaign

May

2020

Summer Sunshine

June

2020

 

 

I think i can achieve it by using looping condition.. something like below:

 

month = campaign's last second word

year = campaign's last word

For(words in Campaign; words < campaign's last second word; next word)

     Marketing _campaign_title = campaign title + words

 

 

I wish i have something like "Multi-Row-Formula" which can access words in a phrase of the current record and append them so that in the following hops text can me converted to columns.

 

Thanks..

P.s, I love the Alteryx community.. amazing responses and well structured.. great learning.

Highlighted
11 - Bolide

Hi @psoma ,

Would the below work for your needs? It's a Regex tool with a formula that parses the Marketing Campaign field. Let me know what you think!

 

kayers_0-1591052410007.png

 

P.S. I'm new to using Regex, so it's possible there's a way to write this statement more elegantly!

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

This is the shortest I can make the regular expression (using the Regex tool set to Parse),

 

(.*) (\w+) (\d+)

 

But @kayers method works just as well. 

Highlighted
13 - Pulsar

Hi @psoma,

 

@kayers posted just faster than me.  I had the same solution using the more generic formula in RegEx of   (.*)\s(.*?)\s(.*)  with the same results.  I agree RegEx is the best approach.

Highlighted
6 - Meteoroid

Thanks for the quick responses. RegEx works like charm.

P.s I was consumed by loop option.

Labels