So I have a large datafile which contains the billboard data per week since the 1960's. this is the structure of the data:

As you can see i have filtered on weeks_on_chart showing that 1 album can have multiple entries. I would like to find the highest "weeks on chart" value per variable and output this into a new file which has only 1 entry per album which contains the album entry of the initial file that had the highest weeks on chart. However, I am struggling with the way on how to do this, any suggestions?