# How can we use Math Aggregation in Kibana Visual Builder 6.7?

**URL:** <https://discuss.elastic.co/t/how-can-we-use-math-aggregation-in-kibana-visual-builder-6-7/175814>\
**Category:** Kibana\
**Created:** [April 8, 2019, 10:15am UTC](https://discuss.elastic.co/t/how-can-we-use-math-aggregation-in-kibana-visual-builder-6-7/175814 "2019-04-08T10:15:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sonam\_Verma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonam_verma/32/43505_2.png) [@Sonam\_Verma](https://discuss.elastic.co/u/Sonam_Verma)\
**Post date:** [April 8, 2019, 10:15am UTC](https://discuss.elastic.co/t/how-can-we-use-math-aggregation-in-kibana-visual-builder-6-7/175814/1 "2019-04-08T10:15:11Z")

</div>

I want to perform one calculation. I want to know about what should we provide in variables and how to access our existing fields in document?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [April 8, 2019, 11:43pm UTC](https://discuss.elastic.co/t/how-can-we-use-math-aggregation-in-kibana-visual-builder-6-7/175814/2 "2019-04-08T23:43:21Z")

</div>

Hi, most of the math features in Kibana work on time-based data. What kind of data do you have and what kind of calculation are you looking for?

Some areas to get started:

- Math functions in Timelion: [https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero](https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero) (search for "Math function")
- Math function in Canvas: [https://www.elastic.co/guide/en/kibana/current/canvas-common-functions.html#\_math](https://www.elastic.co/guide/en/kibana/current/canvas-common-functions.html#_math)

---

<div class="post-metadata">

**Author:** ![Sonam\_Verma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonam_verma/32/43505_2.png) [@Sonam\_Verma](https://discuss.elastic.co/u/Sonam_Verma)\
**Post date:** [April 9, 2019, 6:41am UTC](https://discuss.elastic.co/t/how-can-we-use-math-aggregation-in-kibana-visual-builder-6-7/175814/3 "2019-04-09T06:41:42Z")

</div>

Hi, I am using data from a CSV file actually. In my calculation, I want to use the results of 2 Series and using Visual Builder for this. This is what I want to calculate:

YTD (Vol) = (Total Voluntary attrition till the month/avg HC)\*(365/No. of days in the year so far)

The 2 metrics I am talking about are -Total Voluntary Attrition Count and average Head Count.  
I am able to achieve the result of first metric. But How can I obtain the result for second metric because I want to use the result of both metrics.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/9/89a31d5e590049f992ecb2ab0de89dd1bda7b6ec.png) ![Image2](https://us1.discourse-cdn.com/elastic/original/3X/d/3/d373f8fc2f627d0ed1db8a1afaaa5e2e70013263.png)

---

<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:** [May 7, 2019, 6:41am UTC](https://discuss.elastic.co/t/how-can-we-use-math-aggregation-in-kibana-visual-builder-6-7/175814/4 "2019-05-07T06:41:46Z")

</div>

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