Dear list,
I'm a beginner on Stata.

My situation is as follows:
I have 23,000+ IDs (individuals) who each have performed one or more services which creates an invoice. Each record is a line item on an invoice with the interval variable "allowedcharege" A date variable and a transaction number is assigned to each line item to prevent duplication of records.

I want to sort the IDs from the highest calculated sum of the invoices to the lowest.

Thanks
Richard