I have a dataset that includes multiple lines per individual. I want to only keep the earliest instance (by date) of each individual and the last instance (by date) of each individual and omit all other line. What is the best way to do this?
Solved! Go to Solution.
There's a few ways you can approach this. In most cases, you'll first need to identify the records you want to keep, then filter. The most important thing to keep in mind is the format of your date field. If it is a string field then "3-11-2018" would come before "3-2-2018". I recommend converting to a date-type field first.
See the attached example for 3 different ways to get only the first and last records for each user.
Thanks for the help.