Doc_count calculations


Is there any way to use the doc_count value of an aggregation for further calculations?
Below is a part of a terms aggregation result I am working on.
"buckets": [
"key": "All",
"doc_count": 15
"key": "completed",
"doc_count": 10
I need to find the difference between doc_count. for eg:
"key": "InProgress",
"doc_count": 5
Is it possible to get in one query?

(Lee Hinman) #2

It sounds like you want something like Pipeline Aggregations, which allow you to perform computation on metric aggregations.

In particular, you may want to check out the derivative pipeline agg:

(system) #3