Hi, I have a dataset which has duplicates records, the only field which differentiates them is the latest date and time . Now, ask is to get latest record , I tried sorting and then fetching Unique but it is not picking up latest date.
Field 1 | Field 2 |
a | 11-12-2024 15:45 |
a | 15-12-2024 04:31 |
a | 15-12-2024 04:32 |
Solved! Go to Solution.
Unique will always take the first record for each ID. Try reversing your sort order.
Use summarise to pick the latest date for each data line (add the parameters in group by).
Use this to join back to your original data to pick the remaining data. Unless you have all the data already after using summarise.
We can Unique Tool with Sorting, Summarize, or Sample tools with Sorting, nice approaches.
New Year Wishes to all. Thank you so much for all your responses. It is of great help also for my other doubt as well.