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 duplicates into single row, contatenate other columns if needed

mrc482
5 - Atom

Hi All,

 

My problem might have a simple solution, but I am new to Alteryx and all my attempts failed.

 

I have a dataset with some request ID's in first column that are duplicated there and I want to summarize the data using this column, but with following requirements:

  • If in other columns data are the same for each ID, then I want this common value to stay in this column as it is
  • If in other columns the data differs then I want them to be concatenated with a comma

The below table illustrates what I want to achieve:

 

Input:

Request IDCompany nameCountryDateStaff NameReviewer name
A1Company ADE30.05.2023Elisabeth ChenMelanie Wood
A1Company ADE30.05.2023John SmithMelanie Wood
A2Company BUK31.12.2023Erica JamesDan Salmon
A2Company BUK31.12.2023Erica JamesMaggie Clark
A2Company BUK30.06.2023Erica JamesSarah Johnson
A3Company CES14.05.2023Sandra PinkPaul Griffin
A3Company CES14.05.2023Sandra PinkPaul Griffin

 

Outcome that I would like to get:

Request IDCompany nameCountryDateStaff NameReviewer name
A1Company ADE30.05.2023Elisabeth Chen, John SmithMelanie Wood
A2Company BUK31.12.2023, 30.06.2023Erica JamesDan Salmon, Maggie Clark, Sarah Johnson
A3Company CES14.05.2023Sandra PinkPaul Griffin

 

I tried to use Summarize tool, but the data are always contatentaing, for example for ID request A2 I had "Erica James, Erica James, Erica James" in Staff Name column and I want to avoid it

 

Thanks in advance

5 REPLIES 5
binuacs
21 - Polaris

@mrc482 One way of doing this

binuacs_0-1678142670211.png

 

Yoshiro_Fujimori
15 - Aurora

@binuacs ,

Your solution is very elegant. Thank you for sharing this! (I am not good at Tile tool...)

 

@mrc482 ,

Here's an alternative way of doing this (not so elegant one. Just FYI😉)

Yoshiro_Fujimori_0-1678144150573.png

 

gaoa
11 - Bolide

@mrc482 Here's my attempt at the question. 😊

gaoa_0-1678146231705.png

flying008
15 - Aurora

Hi, @mrc482 

 

Another way by use a macro of gallery:

 

录制_2023_03_07_09_22_17_78.gif

 

mrc482
5 - Atom

@binuacs Thanks for your solution, it works perfectly and I will recreate it in my workflow! 

 

@flying008

@gaoa

@Yoshiro_Fujimori 

 

Thank you all for your solutions, I analyzed all of them and it is very educational for me :) 

Labels