Next Record within a group

38 Views Asked by At

I have these records grouped by Animal ID since many of the same animals come and go from the facility, so an animal will have multiple records. I want to create a function that gets the length an animal stayed here. However, I want to ignore the animals that have an outcome_type = 'RTO' followed by an intake_type = 'OWNER SUR' within the same. Does anyone know how I can ignore these values. I attached an image for reference. enter image description here

0

There are 0 best solutions below