Hello Stata Community,

I am new to Stata and have a question regarding the aggregation of a dataset.

Among other datasets, I have one which comprises accounting data for different countries. Basically, the data is structured as follows:
id year revenue ...
1 2001 ... ...
1 2002 ... ...
1 2003 ... ...
2 2015 ... ...
... ... ... ...
My question is whether there is a way to aggregate the data so that for each id there is only one row with the data of the most recent year. So in the case of company with the id "1", I would like to only have the data for year "2003".

Since I am new to Stata and not sure whether this is important, I just mention it. The id is type "str" and the year is type "int".

Thanks a lot in advance, I would welcome every idea of a solution.

Best regards
Sebastian Ebener