# How to do math with the visual builder

**URL:** <https://discuss.elastic.co/t/how-to-do-math-with-the-visual-builder/182457>\
**Category:** Kibana\
**Created:** [May 23, 2019, 1:52pm UTC](https://discuss.elastic.co/t/how-to-do-math-with-the-visual-builder/182457 "2019-05-23T13:52:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![6tUBp3gwd9Zp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/6tubp3gwd9zp/32/45240_2.png) [@6tUBp3gwd9Zp](https://discuss.elastic.co/u/6tUBp3gwd9Zp)\
**Post date:** [May 23, 2019, 1:52pm UTC](https://discuss.elastic.co/t/how-to-do-math-with-the-visual-builder/182457/1 "2019-05-23T13:52:19Z")

</div>

I don't understand how I can do math on an aggregation with the visual builder. It always says that it doesn't know the variable.

![1](https://us1.discourse-cdn.com/elastic/original/3X/b/0/b026e7ee1a406c4d047c3cc1197b27c04061effa.png)

![1](https://us1.discourse-cdn.com/elastic/original/3X/e/b/eb67b919e2723c6cecbc6c1217341abb29d295c6.png)

---

<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:** [May 23, 2019, 3:06pm UTC](https://discuss.elastic.co/t/how-to-do-math-with-the-visual-builder/182457/2 "2019-05-23T15:06:22Z")

</div>

You need to reference the variable as `params.varname`.

---

<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:** [June 20, 2019, 3:06pm UTC](https://discuss.elastic.co/t/how-to-do-math-with-the-visual-builder/182457/3 "2019-06-20T15:06:24Z")

</div>

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