How can I get the bucket script result unconditionally even when the value is 0?

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?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.