# Scripted field in kibana (count)

**URL:** <https://discuss.elastic.co/t/scripted-field-in-kibana-count/140647>\
**Category:** Kibana\
**Created:** [July 19, 2018, 3:00am UTC](https://discuss.elastic.co/t/scripted-field-in-kibana-count/140647 "2018-07-19T03:00:30Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [July 19, 2018, 9:50pm UTC](https://discuss.elastic.co/t/scripted-field-in-kibana-count/140647/4 "2018-07-19T21:50:14Z")

</div>

Scripted fields only have access to the one document at a time, so you can provide a conditional check for certain fields but can't aggregate across documents.

If you want the total count of males you can do a data table visualization with a term or filter aggregation on gender. Does that help?

---

_[View the full topic](https://discuss.elastic.co/t/scripted-field-in-kibana-count/140647)._
