# How to use maxbucket of serial difference in kibana?

**URL:** <https://discuss.elastic.co/t/how-to-use-maxbucket-of-serial-difference-in-kibana/220495>\
**Category:** Kibana\
**Created:** [February 22, 2020, 3:19pm UTC](https://discuss.elastic.co/t/how-to-use-maxbucket-of-serial-difference-in-kibana/220495 "2020-02-22T15:19:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjilinga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anjilinga/32/86010_2.png) [@anjilinga](https://discuss.elastic.co/u/anjilinga)\
**Post date:** [February 22, 2020, 3:19pm UTC](https://discuss.elastic.co/t/how-to-use-maxbucket-of-serial-difference-in-kibana/220495/1 "2020-02-22T15:19:47Z")

</div>

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"
      }
  }
    
       }
     
  }

```

}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 21, 2020, 3:20pm UTC](https://discuss.elastic.co/t/how-to-use-maxbucket-of-serial-difference-in-kibana/220495/2 "2020-03-21T15:20:07Z")

</div>

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