I have a very large list of patients, each with several admissions to a hospital. For every admission, I would like to calculate the number of previous admissions within a y