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

Combine rows into 5

JDong
8 - Asteroid

Hi Team,

 

In Alteryx how do I combine these rows ? As noticed it creates duplicate rows and we just need SubName columns so eventually there will be only 5 rows

 

Col1TypeNameSubName
Company1AApple 
Company1BApple 
Company1CApple 
Company1DApple 
Company1EApple 
Company1AAppleCET
Company1BAppleCET
Company1CAppleCET
Company1DAppleCET
Company1EAppleCET

 

Thanks

7 REPLIES 7
RolandSchubert
16 - Nebula
16 - Nebula

Hi @JDong ,

 

what exactly do you mean by "combine"? The Summarize tool could be an option (e.g. Group By Col1, Type and Name and Concatenate SubName). Could you explain in more detail, what result you expect?

 

Best,

 

Roland

JDong
8 - Asteroid

Thanks

 

Company1AAppleCET
Company1BAppleCET
Company1CAppleCET
Company1DAppleCET
Company1EApple

CET

 

Expected outcome

RolandSchubert
16 - Nebula
16 - Nebula

So I think, the Summarize tool will be helpful. But - it seems, you want to keep the rows with SubName (if available). So you can use group by as already explained and "MAX" for SubName.I've attached a sample workflow. What do you think?

 

 

JDong
8 - Asteroid

Thanks. What if I need to left join this result with another say 20 columns. Will it again duplicate and the left join will be a combination of numbers and strings.

 

 

RolandSchubert
16 - Nebula
16 - Nebula

Hi @JDong ,

 

if you can join on all fields (Col1, Type, Name, SubName) there should be no duplication, this will only happen, if you join only on e.g. Col1, Name and SubName (same value for all rows, so each record will join to each record of the other dataset and the result will be 5 records for each matching row.

 

Best,

Roland

JDong
8 - Asteroid

Thanks the left table will not have all the join columns but have just the one ID column to join. Can I use unique after the join ?

RolandSchubert
16 - Nebula
16 - Nebula

I'm still not quite sure what you want to achieve. As I understood, you have one table with 20 columns including an ID column. You want to join this to new second table with columns Col1, Type, Name and SubName, I guess, to add additional columns. The main questions is, which of the columns in table 2 ( Col1, Type, Name and SubName) is available in table 1 and can be used to join. Depending on the data, a unique may make sense. Could you explain the relation between the tables in more detail or provide sample data? Will be much easier then.

Labels