# Visual Builder - time range for count?

**URL:** https://discuss.elastic.co/t/visual-builder-time-range-for-count/100858
**Category:** Kibana
**Created:** [September 18, 2017, 10:45am UTC](https://discuss.elastic.co/t/visual-builder-time-range-for-count/100858 "2017-09-18T10:45:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Akaren](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Akaren](https://discuss.elastic.co/u/Akaren)
#### Post date: [September 18, 2017, 10:45am UTC](https://discuss.elastic.co/t/visual-builder-time-range-for-count/100858/1 "2017-09-18T10:45:39Z")

</div>

Hi, I have created in Visual Builder chart. I just want count all events in my selected time range. My time range is last 5 minutes. But when I change chart from Time series to Metric, it doesn't shows count of all values = 9 but just 0. Why?

 ![builder](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ec375992d16cdcba274dbf36bda57bbf942b0004.png)

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [September 18, 2017, 8:06pm UTC](https://discuss.elastic.co/t/visual-builder-time-range-for-count/100858/2 "2017-09-18T20:06:08Z")

</div>

Yes, metric is just showing the last value in that case. There is another aggregation you can add `Cumulative Sum` and then select your first aggregation `Count` so that it knows what to aggregate. This should give you the total over your time span.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/c/1c014dcc4f5639998f6f755a8c4be25426908e8d.png)

Regards,  
Lee

---

<div class="post-metadata">

### Author: ![Akaren](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Akaren](https://discuss.elastic.co/u/Akaren)
#### Post date: [September 19, 2017, 7:28am UTC](https://discuss.elastic.co/t/visual-builder-time-range-for-count/100858/3 "2017-09-19T07:28:31Z")

</div>

Ah! Thank you! I thought it's the same way as in Kibana charts.

---

<div class="post-metadata">

### Author: ![Akaren](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@Akaren](https://discuss.elastic.co/u/Akaren)
#### Post date: [September 19, 2017, 8:38am UTC](https://discuss.elastic.co/t/visual-builder-time-range-for-count/100858/4 "2017-09-19T08:38:29Z")

</div>

One question. What exactly is "the last value in that case". Is it the value from last event? What if in the same time, I will receive two events? Will it sum it up?

---

<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: [October 17, 2017, 8:38am UTC](https://discuss.elastic.co/t/visual-builder-time-range-for-count/100858/5 "2017-10-17T08:38:31Z")

</div>

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