# Compare between many fields?

**URL:** https://discuss.elastic.co/t/compare-between-many-fields/42222
**Category:** Kibana
**Created:** [February 19, 2016, 9:12am UTC](https://discuss.elastic.co/t/compare-between-many-fields/42222 "2016-02-19T09:12:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kacemrostom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kacemrostom/32/6926_2.png) [@kacemrostom](https://discuss.elastic.co/u/kacemrostom)
#### Post date: [February 19, 2016, 9:12am UTC](https://discuss.elastic.co/t/compare-between-many-fields/42222/1 "2016-02-19T09:12:47Z")

</div>

Hello.  
So i was wondering if it's possible to sum-up the value contained in a given field within all docs and then compare it to another field in order to construct a pie?

Example:  
A doc contain the field sales\_revenues\_usa and another field sales\_revenues\_uk and another fields sales\_revenues\_russia. each doc has the value for each field for a given day. what i want to achieve is summing up the values for each field and then construct a pie chart to visualise which country has which percentile?

is that possible though Kibana?

---

<div class="post-metadata">

### Author: ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)
#### Post date: [February 19, 2016, 1:55pm UTC](https://discuss.elastic.co/t/compare-between-many-fields/42222/2 "2016-02-19T13:55:00Z")

</div>

You can use a scripted field in Kibana to sum up the values (see in Settings \>\> index \>\> field \>\> Scripted Fields). This will create a field you can use in visualizations, alongside regular fields.

---

<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: [July 6, 2017, 2:01pm UTC](https://discuss.elastic.co/t/compare-between-many-fields/42222/3 "2017-07-06T14:01:42Z")

</div>


