Use the date of the first alert for each device to determine how long it's been monitored, and in the calculation of the average number of alerts per day.