Alteryx Designer Desktop Discussions

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

Splitting data without delimiters, referring to other data in the same column

kwieto
8 - Asteroid

I see today is is the day of asking for help for me :)

I have values in a column, which I want to split for further processing. Part of them is comma separated, but part of them not. Each value is a string, which can contain two words or more.
What I can assume is that for most cases where there are more than one value in a field, I can find other field in the same column where each of the values will be alone, or separated by a comma.

 

Initially I tried to split data into rows simply by comma, list all unique values for the column and filter out longest ones (base assumption: if there is no delimiter, then the field after the split should have the longest strings in it), and then use find-replace to add artificial delimiters to the data. But that doesn't work perfectly as sometimes one single value is longer than combination of two others.
As a workaround I do a split of the data as they are now, aggregate results, look what should be corrected and then put it manually on a source list for find-replace before the split and re-run the workflow.
But I look for something less manual, as the current way is not good for broader variety of data.


Below the sample how data are organized currently:

1Blue Carrot
2Orange Carrot
3Very Big and Delicious Green Potato, Orange Carrot
4Very Big and Delicious Green Potato
5Very Big and Delicious Green Potato Black Berry
6Black Berry, Black Potato
7Blue Carrot Very Big and Delicious Green Potato Black Berry
8Black Berry Very Big and Delicious Green Potato, Blue Carrot
9Black Berry Blue Berry

 

 

And the output should look like that:

1Blue Carrot
2Orange Carrot
3Very Big and Delicious Green Potato
3Orange Carrot
4Very Big and Delicious Green Potato
5Very Big and Delicious Green Potato
5Black Berry
6Black Berry
6Black Potato
7Blue Carrot
7Very Big and Delicious Green Potato
7Black Berry
8Black Berry
8Very Big and Delicious Green Potato
8Blue Carrot
9Black Berry
9Blue Berry
10 REPLIES 10
kwieto
8 - Asteroid

I did that already for the post with iterative macro

Labels