# Scripted field in kibana show average -filter not working

**URL:** <https://discuss.elastic.co/t/scripted-field-in-kibana-show-average-filter-not-working/158868>\
**Category:** Kibana\
**Created:** [November 30, 2018, 8:03am UTC](https://discuss.elastic.co/t/scripted-field-in-kibana-show-average-filter-not-working/158868 "2018-11-30T08:03:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shraddha5894](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@shraddha5894](https://discuss.elastic.co/u/shraddha5894)\
**Post date:** [November 30, 2018, 8:03am UTC](https://discuss.elastic.co/t/scripted-field-in-kibana-show-average-filter-not-working/158868/1 "2018-11-30T08:03:31Z")

</div>

I have stored an array in an index

"ipChanges": [  
{  
"name": "nikhil",  
"changes": 20  
},  
{  
"name": "gaglani",  
"changes": 40  
},  
{  
"name": "gaglani",  
"changes": 30  
}

.......  
],

and now for kibana dashboard we have to display record for each user separately. such that: we can filter by if ipChanges.name = 'gaglani' then display the average changes of gagalani which is 35.  
But current if we put filter by name, then also it is displaying total average which is 30

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [December 3, 2018, 5:51pm UTC](https://discuss.elastic.co/t/scripted-field-in-kibana-show-average-filter-not-working/158868/2 "2018-12-03T17:51:15Z")

</div>

I have not been able to reproduce your issue. Can you share which version of Kibana and Elasticsearch you are using?

Is each item in the `ipChanges` array stored as separate documents in Elasticsearch?

---

<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:** [December 31, 2018, 5:51pm UTC](https://discuss.elastic.co/t/scripted-field-in-kibana-show-average-filter-not-working/158868/3 "2018-12-31T17:51:19Z")

</div>

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