Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
Andy Uttley, Alteryx ACE, makes music with Alteryx | Math + Music

Removing a duplicate and replacing with the most recent row

Highlighted
5 - Atom

Hi,

 

I'm new to Alteryx.

 

I am working with 2 data sources and I am finding duplicates occurring in the workflow. I want to keep the most recent duplicate row and remove the other(s). What would be the best approach for this?

Many thanks

 

T

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@Tristan

 

Use a Sort tool to sort by date Ascending, then a Sample tool set to Last N Record with n=1 and Grouping field by identifying fields for that row/group. 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@CharlieS suggestion will work fine but an alternative is the 'unique tool'. The way the unique tool works is that it will find the first record for a given grouping and pass that into the 'u' stream. It will then put the 2nd, 3rd, etc. instances into the D stream.

 

So in order to use the unique tool you would have to sort on your date in descending order.

 

Ben

Highlighted
5 - Atom

Thanks very much for your response. I will have a good with this method

 

T

Labels