I have a series of patient identifiers. For many there are multiple rows for the same patient. Each row has a date, so Id like to create a new column which will be a number corresponding to rank in time for that row. For some patients there would only be one entry (row) which will be a 1. For others there will be multiple rows and id like them to be to ranked 1-10 (or however many) according to time, ie. first entry 1, last entry 10.