# Need to find the average on multiple fields by id

**URL:** <https://discuss.elastic.co/t/need-to-find-the-average-on-multiple-fields-by-id/147843>\
**Category:** Elasticsearch\
**Created:** [September 9, 2018, 5:32am UTC](https://discuss.elastic.co/t/need-to-find-the-average-on-multiple-fields-by-id/147843 "2018-09-09T05:32:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajesh.ramadoss](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@rajesh.ramadoss](https://discuss.elastic.co/u/rajesh.ramadoss)\
**Post date:** [September 9, 2018, 5:32am UTC](https://discuss.elastic.co/t/need-to-find-the-average-on-multiple-fields-by-id/147843/1 "2018-09-09T05:32:23Z")

</div>

I need to find the average on multiple fields for each id.  
Given the data:  
{id, maths, physics, english }  
{CS001, 92, 85 , 76}  
{CS002, 99, 75 , 66}  
{CS003, 92, 85 , 76}  
{CS004, 92, 85 , 76}  
{CS001, 92, 85 , 76}  
{CS002, 92, 85 , 76}  
{CS003, 92, 85 , 76}  
{CS004, 92, 85 , 76}  
{CS001, 92, 85 , 76}  
{CS002, 92, 85 , 76}  
{CS003, 92, 85 , 76}  
{CS004, 92, 85 , 76}  
.  
.  
.  
..  
.

I need the output as the average of three fields for each of the member id

{CS001, 92, 85 , 76}  
{CS002, 92, 85 , 76}  
{CS003, 92, 85 , 76}  
{CS004, 92, 85 , 76}

Please suggest.

Thanks !

---

<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:** [October 7, 2018, 5:32am UTC](https://discuss.elastic.co/t/need-to-find-the-average-on-multiple-fields-by-id/147843/2 "2018-10-07T05:32:30Z")

</div>

Closed on October 7, 2018, 5:32am UTC

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