# Drop first bucket in visual builder aggregation

**URL:** https://discuss.elastic.co/t/drop-first-bucket-in-visual-builder-aggregation/172691
**Category:** Kibana
**Created:** [March 17, 2019, 10:48pm UTC](https://discuss.elastic.co/t/drop-first-bucket-in-visual-builder-aggregation/172691 "2019-03-17T22:48:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nandrik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nandrik/32/39951_2.png) [@nandrik](https://discuss.elastic.co/u/nandrik)
#### Post date: [March 17, 2019, 10:48pm UTC](https://discuss.elastic.co/t/drop-first-bucket-in-visual-builder-aggregation/172691/1 "2019-03-17T22:48:25Z")

</div>

I've seen the post: [Dropping first point sum aggregation visual builder](https://discuss.elastic.co/t/dropping-first-point-sum-aggregation-visual-builder/167195) and I wonder if there are any updates on being able to drop the first aggregation bucket that distorts the graph, similarly to the way you can drop the last bucket through `Panel Options --> Drop Last Bucket → Yes`.

This creates the unpleasant issue of not being able to calculate an accurate average across all the buckets.

![Graph_first_bucket](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f70fd3fc8760803c0994993ec23f084e8dac63e.png)

---

<div class="post-metadata">

### Author: ![nandrik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nandrik/32/39951_2.png) [@nandrik](https://discuss.elastic.co/u/nandrik)
#### Post date: [March 18, 2019, 12:56am UTC](https://discuss.elastic.co/t/drop-first-bucket-in-visual-builder-aggregation/172691/2 "2019-03-18T00:56:39Z")

</div>

OK, so I found a partial solution.

Instead of using a fixed time interval, I used a dynamic one.

In other words, instead of:

```auto
(30 min x 60 seconds ) / (max_metric - min_metric)

```

I did:

```auto
(max_timestamp - min_timestamp) / (max_metric - min_metric)

```

 ![Graph_first_bucket_2](https://us1.discourse-cdn.com/elastic/original/3X/9/1/91d627b238aadd672c69e6e4a879e355e9f3fb97.png)  
This somewhat took care of this first partial bucket that was distorting the results.

Still, the first bucket **keeps oscillating a bit** and sometimes throws an error about **division by zero**. Think it would be good to have an option to drop the first bucket similar to what exists for the last one.

---

<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: [April 15, 2019, 12:56am UTC](https://discuss.elastic.co/t/drop-first-bucket-in-visual-builder-aggregation/172691/3 "2019-04-15T00:56:49Z")

</div>

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