# Kibana canvas: how to add the values of 2 elements

**URL:** <https://discuss.elastic.co/t/kibana-canvas-how-to-add-the-values-of-2-elements/280166>\
**Category:** Kibana\
**Created:** [August 1, 2021, 11:09pm UTC](https://discuss.elastic.co/t/kibana-canvas-how-to-add-the-values-of-2-elements/280166 "2021-08-01T23:09:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabor](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@gabor](https://discuss.elastic.co/u/gabor)\
**Post date:** [August 1, 2021, 11:09pm UTC](https://discuss.elastic.co/t/kibana-canvas-how-to-add-the-values-of-2-elements/280166/1 "2021-08-01T23:09:16Z")

</div>

Hi,

I have two markdown elements on canvas showing the results of the same essql query but for 2 different IP addresses. I need a 3rd, which should hold the sum of the values from these 2 elements.

I tried to create a variable (let's say clients1) in the "Workpad" settings and use the following (part in both element's "Expression editor" but to no avail:

```auto
essql SELECT total_clients .... | var_set name=clients1 value={getCell "total_clients" } | ...

```

No such thing as a global variable apparently...

Is summing the results of 2 elements possible? How? (note: the essql queries use a LIMIT 1 at the end, so combining the SQL statements for the summarized markdown element does not work either)

Thanks,  
Gábor

---

<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:** [August 12, 2021, 5:53pm UTC](https://discuss.elastic.co/t/kibana-canvas-how-to-add-the-values-of-2-elements/280166/2 "2021-08-12T17:53:03Z")

</div>

Could you make an element with 2 variables, one with the value of the first query and another for the value of the second query (instead of combining the 2 SQL statements)? Then the element can show the sum of the two variables.

---

<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:** [September 9, 2021, 5:54pm UTC](https://discuss.elastic.co/t/kibana-canvas-how-to-add-the-values-of-2-elements/280166/3 "2021-09-09T17:54:03Z")

</div>

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