1.Calculate the total time using sum aggs.
2. Calculate the number of users using cardinality aggs.
3. Count the total time/number of users using a bucket script to get the average time.
However, if the total time is 0 or the number of users is 0, bucket script results are not provided.
How can I set it to 0 if there is no current value?