# Kibana Math Aggregation on Terms

**URL:** https://discuss.elastic.co/t/kibana-math-aggregation-on-terms/250816
**Category:** Kibana
**Created:** [October 2, 2020, 3:42pm UTC](https://discuss.elastic.co/t/kibana-math-aggregation-on-terms/250816 "2020-10-02T15:42:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![savior1307](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/savior1307/32/76578_2.png) [@savior1307](https://discuss.elastic.co/u/savior1307)
#### Post date: [October 2, 2020, 3:42pm UTC](https://discuss.elastic.co/t/kibana-math-aggregation-on-terms/250816/1 "2020-10-02T15:42:14Z")

</div>

# Kibana Term Math Aggregation

Hey guys,  
I'd like to ask if there's any way to do Math aggregation on individual Term buckets in TSVB.

## TSVB Metric

I've divided my data into buckets by Term and aggregated by Count.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/e/fe412941c5e54716cbc7706552b79e9cdc0dd4b1.png)

This is just count of individual Types.

I need to do some Math on those values and visually show those metrics.

I think the best way should be the Math aggregation on Count aggregation. But i cannot access those values through `params` field.

Can somebody show me the right way to do something like this?  
`params.c['DOT_START'] - params.c['DOT_FAILED_TIMEOUT']`.

I think it should be done something like this, but it's not the case.

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

Thanks.

---

<div class="post-metadata">

### Author: ![Sh3ldoris](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sh3ldoris/32/76665_2.png) [@Sh3ldoris](https://discuss.elastic.co/u/Sh3ldoris)
#### Post date: [October 5, 2020, 1:54pm UTC](https://discuss.elastic.co/t/kibana-math-aggregation-on-terms/250816/2 "2020-10-05T13:54:37Z")

</div>

Hey, I've got a similar issue when I'm trying to do some subtraction within one field so help would be great. Thx.

---

<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, 1:55pm UTC](https://discuss.elastic.co/t/kibana-math-aggregation-on-terms/250816/3 "2020-11-02T13:55:13Z")

</div>

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