Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Combine Data Pairs from Multiple Columns with Delimiters

nat0028
6 - Meteoroid

Hi,

 

Beginner here.  I have data strings in 2 columns separated by delimiters:

 

COLUMN ACOLUMN B
A,B,C,D,E1,,1,1,1
B,D,E,,2
C,D1,1
A,C,D,E1,3,2,

 

I'm looking to have the following output.

 

COLUMN 1COLUMN 2COLUMN 3COLUMN 4COLUMN 5
A-1B-C-1D-1E-1
 B- D-E-2
  C-1D-1 
A-1 C-3D-2E-

 

Just looking the first few steps as I'm drawing a blank.  Thanks.

 

9 REPLIES 9
Emil_Kos
17 - Castor
17 - Castor

Hi @nat0028,

 

I am not sure if you can accomplish that. 

 

Let's look at the second line there is BDE and ,,2 There is no indication that it should go to the column second fourth and five. 

 

Unless there is some kind of pattern here but I don't see it here.

 

KarolinaRoza
11 - Bolide

Hi,

 

@Emil_Kos i see the pattern 😉 but my question is: @nat0028: do you always have data like A, B, C.. which goes to first, second, third etc columns in desired results?

 

Or is it sample dataset? And you have real strings, i mean words or sentences separated by comma?

In that case it would be little harder to achieve it.

 

Now I do not have Alteryx open in front of me, but tommorow I should be able to help you unless someone already solve it:-)  

 

Karolina

nat0028
6 - Meteoroid

The data in source column A are set.  They're pretty much fixed category names while values in col B can be variable.  So we can replace the values like below.  Hope it makes it clearer.

 

SOURCE    
COLUMN ACOLUMN B   
HEIGHT,WEIGHT,GENDER,HOBBIES,SIZE1,,1,1,1   
WEIGHT,HOBBIES,SIZE,,2   
GENDER,HOBBIES1,1   
HEIGHT,GENDER,HOBBIES,SIZE1,3,2,   
     
     
RESULT    
COLUMN 1COLUMN 2COLUMN 3COLUMN 4COLUMN 5
HEIGHT-1WEIGHT-GENDER-1HOBBIES-1SIZE-1
 WEIGHT- HOBBIES-SIZE-2
  GENDER-1HOBBIES-1 
HEIGHT-1 GENDER-3HOBBIES-2SIZE-
Emil_Kos
17 - Castor
17 - Castor

Hi @nat0028,

 

The data will always have 4 rows? If not they will always come in the same sequence afterwards? 

 

nat0028
6 - Meteoroid

The data can have more rows that the example.  However, the sequence of how the values in Column A come in are fixed, so HEIGHT,WEIGHT,GENDER,HOBBIES,SIZE in this order, except that in some rows, some of them will be missing.  As far as I can tell, there are only 5 possible "headers" as well.  Thanks.

KarolinaRoza
11 - Bolide

hi @nat0028 ,

 

Finally I was possible to sit and focus on your case 🙂

 

 

I think I was able to find the solution (attached).

Few comments:

- I added extra comma for cases for which Column B ends with comma as in fact there is 'empty' field.

- columns with key words like :HEIGHT,WEIGHT,GENDER,HOBBIES,SIZE are fixed, so I used Text Input tool. I hope it is enough for your exercise, in case you will have more, you can add it to the lst.

-please test it on your side, as i am not sure if I checked all cases, and let me know if it anything must be adjsuted.

 

KarolinaRoza_0-1630083415417.png

 

Cheers,

Karolina 

 

nat0028
6 - Meteoroid

This looks very promising.  I'm going to take it back and test with a larger data set.

nat0028
6 - Meteoroid

Tested with a larger data set and it worked.  Thanks again.

KarolinaRoza
11 - Bolide

@nat0028 

 

Great! I am grad that I could help you.

 

Regards,

Karolina

Labels