# Display sum of two valiues as percentage in Kibana 5.3

**URL:** <https://discuss.elastic.co/t/display-sum-of-two-valiues-as-percentage-in-kibana-5-3/84334>\
**Category:** Kibana\
**Created:** [May 3, 2017, 12:22am UTC](https://discuss.elastic.co/t/display-sum-of-two-valiues-as-percentage-in-kibana-5-3/84334 "2017-05-03T00:22:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeyE](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@MikeyE](https://discuss.elastic.co/u/MikeyE)\
**Post date:** [May 3, 2017, 12:22am UTC](https://discuss.elastic.co/t/display-sum-of-two-valiues-as-percentage-in-kibana-5-3/84334/1 "2017-05-03T00:22:39Z")

</div>

Hi  
I apologize for my beginner question.  
I've created an index in elasticstack with contains all my servers and includes fields for server function, installed and used memory, example below:  
name, function, installed memory, used memory  
server1, Database, 512, 128  
server2, web. 512, 64  
server3, web, 512, 512

In Kibana 5.3, how do I display in tabular form the sum of installed memory, sum of used memory and % used memory by server function?

I've created Data Table Visualization which displays the sum of installed and used memory by server function but I can't see how to add the sum of used memory as a percentange of the sum of the installed memory.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [May 3, 2017, 6:43pm UTC](https://discuss.elastic.co/t/display-sum-of-two-valiues-as-percentage-in-kibana-5-3/84334/2 "2017-05-03T18:43:45Z")

</div>

You can create a data table with the following metrics:

Aggregation: Sum  
Field: "installed memory"

Aggregation: Sum  
Field: "used memory"

Then split the rows on a Terms aggregation on the function.

In order to get the percentage, you will need to add a scripted field. You can do this in Management under your index pattern. Select the scripted field. You script would look something like this `doc['mem.used'].value / doc['mem.installed'].value`

---

<div class="post-metadata">

**Author:** ![MikeyE](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@MikeyE](https://discuss.elastic.co/u/MikeyE)\
**Post date:** [May 3, 2017, 11:47pm UTC](https://discuss.elastic.co/t/display-sum-of-two-valiues-as-percentage-in-kibana-5-3/84334/3 "2017-05-03T23:47:52Z")

</div>

Thanks for the info on the data table

Re. the percentage - I'm not sure your suggestion will work for me as I think the scripted field will calculate the result for each row (which I can then aggregate in the data table) whereas I want to calculate the percentage of the aggregated values. Is this possible?

---

<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 1, 2017, 12:00am UTC](https://discuss.elastic.co/t/display-sum-of-two-valiues-as-percentage-in-kibana-5-3/84334/4 "2017-06-01T00:00:31Z")

</div>

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