How to use maxbucket of serial difference in kibana?

I have the daily data with cumilative value, i want to do view the graph for the maximum in the week wise.

in kiban vertical bar visulization, i have the option like serial diff of max bucket, but i have to use the max bucket of seial difference.
in elastc query i can get as below. how to achieve this in kibana

{
"size": 0,
"aggs": {
"my_date_histo": {
"date_histogram": {
"field": "@timestamp",
"calendar_interval": "week"
},
"aggs": {
"my_date":{
"date_histogram": {
"field": "@timestamp",
"calendar_interval": "day"

     },
     "aggs": {
     "the_sum1":{
       "sum": {
         "field": "Call-Id"
       }
       },
      "day_difference": {
           "serial_diff": {                
              "buckets_path": "the_sum1",
              "lag" : 1
           }
       
       }
       
        }
      },
  "day_max":{
      "max_bucket": {
        "buckets_path": "my_date>day_difference"
      }
  }
    
       }
     
  }

}

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