If we add a “number of minutes” filed to our Cases table we can calculate the average number of minutes dynamically.
As our employees get faster or slower resolving certain categories of cases our query will update the averages.
Perhaps we realize that some employees are faster than other with certain categories of cases. We can factor that into our query.
Now we can display all the information needed to decide which user to assign a new case to.
For each emplooyee we show the average minutes they take to complete this category of task, the number of active cases they have and the total minutes of work expected for those cases.
We can imagine that for different customers the same employee might have different average times for some categories. We could assign a “difficulty factor” to the customer and then factor that into our calculations. An exercise left to the reader.