Can I perform derivative aggregation without date_histogram?

I want to perform derivative aggregation on following query

{
"size": 0,
"aggs": {
"sales_per_month": {
"date_histogram": {
"field": "device_time",
"format": "dd-MM-yyyy",
"interval": "day"
},
"aggs": {
"a1": {
"terms": {
"field": "device_time",
"size": 500,
"order": {
"the_sum": "asc"
}
},
"aggs": {
"the_sum": {
"sum": {
"field": "device_time"
}
}
}
}
}
}
}
}

but when I am trying to perform its giving error as a derivative aggregation [derivative] must have a histogram or date_histogram as parent??

How can i perform derivative aggregation on this query( on the_sum bucket)

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