Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Deduplicate rows group by one column keep row based on another column

tinapai
5 - Atom

I want to deduplicate my rows grouped by one column, keep all the other columns, but choose which row is kept based on another column. How do I do this?

 

For example, I want to aggregate the rows based on ID and keep the row with min(Criteria_Column).

Before:

 

IDCriteria_ColumnOther_Column_1Other_Column_2
1239as
12310df
45614jk

 

After:

IDCriteria_ColumnOther_Column_1Other_Column_2
1239as
45614jk

 

It seems similar to the Unique tool except that I can't find any setting on the Unique tool where I can choose a criteria by which to decide which row to keep.

3 REPLIES 3
Qiu
21 - Polaris
21 - Polaris

@tinapai 
I believe Sort Tool is a good fit for this case.

Capture1.PNG

cgoodman3
14 - Magnetar
14 - Magnetar

The summarize tool would give you this functionality. Group by ID and then use min for the other fields. Alternatively, you can sort your data and use the unique which will keep the first value.

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
tinapai
5 - Atom

@cgoodman3 I think that would give me the min of each group for each of the columns, which is different from what I wanted-- I want the values of the row which has min(Criteria_Column) regardless of what is in the other columns.

Labels