Yes that is correct I want the time spent inqueue. All the fields are extracted and can be used directly. Duration is basically the time elapsed since the object got created. What i want to do is for each object i want to find the duration at which its state was "IN_QUEUE_2" and subtract it with the duration at which it was in state "IN_QUEUE_1", which gives me the time spent in the first queue, get the average of this value and group it by the object type. There will be many objects of each type , each object has a unique id and each object goes through state "IN_QUEUE1" -> "IN_QUEUE_2". So end data should look like : Object type. Avg inqueue time type 1 12 type 2 20 ...
... View more