# How can i Disply the result of division between two field?

**URL:** https://discuss.elastic.co/t/how-can-i-disply-the-result-of-division-between-two-field/98502
**Category:** Kibana
**Created:** [August 28, 2017, 3:32am UTC](https://discuss.elastic.co/t/how-can-i-disply-the-result-of-division-between-two-field/98502 "2017-08-28T03:32:39Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [August 28, 2017, 6:31pm UTC](https://discuss.elastic.co/t/how-can-i-disply-the-result-of-division-between-two-field/98502/2 "2017-08-28T18:31:05Z")

</div>

Hi

Possibly this can be achieved by Pipeline aggregations in ES. . These are aggregations that work on the result of other aggregations. In your example, you could use a bucket\_script pipeline aggregation. For ex: I just considered sum\_1 and sum\_2

```auto
"aggs": {
  "sum_1": {
    "sum": {
      "field": "abc"
    }
  },
  "sum_2": {
    "sum": {
      "field": "def"
    }
  },
  "division": {
    "bucket_script": {
      "buckets_path": {
        "my_var1": "sum_1",
        "my_var2": "sum_2"
      },
      "script": "params.my_var1 / params.my_var2"
    }
  }
}

```

Also follow along the math count detailed post in kibana discuss :[Doing Math over count of events](https://discuss.elastic.co/t/doing-math-over-count-of-events/97278) . This might help as well.

thanks  
Rashmi

---

_[View the full topic](https://discuss.elastic.co/t/how-can-i-disply-the-result-of-division-between-two-field/98502)._
