Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
slacayo
Contributor III
Contributor III

Drop duplicates as a subset of two columns

I have a table, I am trying to drop duplicates if they apply to two specific columns

LOAD * INLINE [
 Onum, CID,    Date  
516, 1, 2020-10-05
557, 2, 2021-04-09
667, 3, 2020-11-15
333, 1, 2021-12-05
788, 3, 2021-02-08
667, 3, 2021-04-04
556, 2, 2020-10-31
556, 3, 2021-08-09
556, 3, 2021-09-09
333, 1, 2021-09-09
444, 1, 2020-10-01
516 1, 2020-10-06 ]; 

I want to remove the rows if the `ONUM` and `CID` are the same, nothing else. I don't really care if the first, or last is kept, as long as theres one distinct. Thanks!

Result: 

LOAD * INLINE [
Onum,CID, Date  
516, 1, 2020-10-05
557, 2, 2021-04-09
667, 3, 2020-11-15
788, 3, 2021-02-08
556, 2, 2020-10-31
556, 3, 2021-08-09
333, 1, 2021-09-09
444, 1, 2020-10-01
];

 

 

1 Reply
Or
MVP
MVP

Load Onum, CID, Date(Max(Date)) as Date
Group by Onum, CID;
LOAD * INLINE [  Onum, CID, Date
516, 1, 2020-10-05
557, 2, 2021-04-09
667, 3, 2020-11-15
333, 1, 2021-12-05
788, 3, 2021-02-08
667, 3, 2021-04-04
556, 2, 2020-10-31
556, 3, 2021-08-09
556, 3, 2021-09-09
333, 1, 2021-09-09
444, 1, 2020-10-01
516 1, 2020-10-06 ];