# Is there a way to get " count of records, with Status = 'closed' of previous month DIVIDED BY count of records, with status = 'New' of current month"

**URL:** https://discuss.elastic.co/t/is-there-a-way-to-get-count-of-records-with-status-closed-of-previous-month-divided-by-count-of-records-with-status-new-of-current-month/250163
**Category:** Kibana
**Created:** [September 28, 2020, 9:57am UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-count-of-records-with-status-closed-of-previous-month-divided-by-count-of-records-with-status-new-of-current-month/250163 "2020-09-28T09:57:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pooja](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@Pooja](https://discuss.elastic.co/u/Pooja)
#### Post date: [September 28, 2020, 9:57am UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-count-of-records-with-status-closed-of-previous-month-divided-by-count-of-records-with-status-new-of-current-month/250163/1 "2020-09-28T09:57:53Z")

</div>

I would like to get the following value to be populated on my dashboard.  
(Count of records, whose status: 'Closed', month : @timestamp - 1month) / (Count of records, whose status: 'New', month: @timestamp)

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [October 5, 2020, 5:46pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-count-of-records-with-status-closed-of-previous-month-divided-by-count-of-records-with-status-new-of-current-month/250163/2 "2020-10-05T17:46:31Z")

</div>

I suggest using TSVB and the Math aggregation, that will allow you to do advanced bucket math like this.

---

<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: [November 2, 2020, 5:46pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-get-count-of-records-with-status-closed-of-previous-month-divided-by-count-of-records-with-status-new-of-current-month/250163/3 "2020-11-02T17:46:38Z")

</div>

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