Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Help with column parse

JarkkoP
7 - Meteor

Hi! Im struggling with a parsing of a column into 2 columns. The column has the following kind of data: 

 

Company name 1 - name 1 test1 - example 2

Company-name 2 - name 1 test2 - example 3

Company name-3 - name 2 test4 - example 5

 

I want to split the data into 2 columns

- Everything and including on the right from - name 1 and - name 2 will go to new field A

- everything on the left of - name 1 and - name 2 to new field B. 

 

I've tried findstring, but I cannot add multiple search conditions. Any help with this is much appreciated :)

9 REPLIES 9
pereisyd
7 - Meteor

Could you give a better example of source data? The repetitive "name" is confusing!

gawa
16 - Nebula
16 - Nebula

hi @JarkkoP 

 

Regex tool would help you parse data in this case. Output should look like this? Please refer to the attached WF and modify it so as to fit to your case, if necessary.

image.png

JarkkoP
7 - Meteor

Thanks! Exactly what I needed. And sorry for the bad example data, next time a better example :)

JarkkoP
7 - Meteor

Sorry, my example was really bad! :/ I need to be able to parse them to different columns by multiple conditions. In the example, the string is - Test and - Demo 

 

Company AS - Test FOF XI
Company-2013 AB - Test fund XI
Company OY - Test fund of fund XII-
Nordic Secondary 2013 AB - Demo fund XI.
Nordic-Secondary AB - Demo fund XI
Nordic Secondary 2013 AB - Demo fund-XII

 

Company ASTest FOF XI
Company-2013 ABTest fund XI
Company OYTest fund of fund XII-
Nordic Secondary 2013 ABDemo fund XI.
Nordic-Secondary ABDemo fund XI
Nordic Secondary 2013 ABDemo fund-XII
gawa
16 - Nebula
16 - Nebula

hi @JarkkoP 

 

OK, with the given input, I modified WF. It seems you need to parse data with delimiter " - " which is whitespace-whitespace. As well as previous one, Regex tool can be used.

image.png

JarkkoP
7 - Meteor

Thanks but it does not work. The names might have - between other position also. I need to parse it with - Test and - Demo words in this case, so I need multiple conditions in the Regex :/

gawa
16 - Nebula
16 - Nebula

@JarkkoP 

 

Then, please see attached WF. I went with another Regex expression

^(.+)\s-\s((Test|Demo).+)$

image.png

JarkkoP
7 - Meteor

You're a Star! Thanks Gawa! :)

JarkkoP
7 - Meteor

One more problem with this :) The first column also in some cases contains the seperator name in the first part

 

Company AS - Test FOF XI
Test-2013 AB - Test fund XI
Company OY - Test fund of fund XII-
Demo Secondary 2013 AB - Demo fund XI.
Nordic-Secondary AB - Demo fund XI
Nordic Secondary 2013 AB - Demo fund-XII

 

I tried to modify the Regex, to ^(.+)\s-\s((- Test|- Demo).+)$

 

Bit it does not accept the - sign and returns nothing.. :/

 

Any easy way to make it work?

 

Thanks!! 

Labels