Alteryx Designer Desktop Discussions

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

Split Comma-separated column into multiple columns

SriHari52
5 - Atom

Hi there,

 

I need your help and suggestions with the following scenario. I have the following file 

 

ID_ left ID_ RightNames_ leftNames_ right
16AA,BB,CCDD,FF
27DD,EE,FFHH,LL
38GG,HHJJ,KK,BB

 

My requirement is to split these values different columns like below.

 

ID_ left ID_ RightNames_ leftNames_ right#1_Left#2_Left#3_Left#1_Right#2_Right#3_Right
16AA,BB,CCDD,FFAABBCCDDFF 
27DD,EE,FFHH,LLDDEEFFHHLL 
38GG,HHJJ,KK,BBGGHH JJKKBB

 

I understand we can use text-to-columns to get this output, but let's say I have 500 columns and I have to de-limit those values? Can't think of a solution. Can anyone help?

4 REPLIES 4
IraWatt
17 - Castor
17 - Castor

Hey @SriHari52,

All you need is the text to column tool:

IraWatt_0-1660816155459.png

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

DataNath
17 - Castor

Perhaps a little long-winded but here's a dynamic approach whereby you can just provide a data set with N delimiters where N can be any number, and this ought to automatically handle that without needing to change the configuration each time:

 

DataNath_0-1660816645681.png

Maskell_Rascal
13 - Pulsar

Hi @SriHari52 

 

If its just the two columns with an unknown amount delimited values to split, either of the previous solutions should work for you. I'd opt to use two Text to Column tools with number of columns set to 1000 on each of them, then follow those up with a Data Cleanse tool that is configured to remove Null columns. 

 

If however, your need is to split an unknown number of columns, then this solution will suite you better. 

 

Create a Record ID, Transpose your data, Text to Columns to Spit to Rows, Tile tool for prepping the updated column names, Formula to create new column names, and then flip your data back using the Crosstab Tool. 

 

Maskell_Rascal_0-1660843500286.png

 

Attached is a sample workflow with both solutions for you to try. 

 

Cheers!

Phil

binuacs
21 - Polaris

@SriHari52 One way of doing this with the Transpose and Multi-Row tool

binuacs_0-1660862486925.png

 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels