# How to Count repeated values in Kibana

**URL:** <https://discuss.elastic.co/t/how-to-count-repeated-values-in-kibana/318872>\
**Category:** Elasticsearch\
**Created:** [November 14, 2022, 12:50pm UTC](https://discuss.elastic.co/t/how-to-count-repeated-values-in-kibana/318872 "2022-11-14T12:50:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil\_hcs\_tech](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phil_hcs_tech/32/36508_2.png) [@phil\_hcs\_tech](https://discuss.elastic.co/u/phil_hcs_tech)\
**Post date:** [November 14, 2022, 12:50pm UTC](https://discuss.elastic.co/t/how-to-count-repeated-values-in-kibana/318872/1 "2022-11-14T12:50:04Z")

</div>

I have an index storing family data. One of the properties is "childrenAges" which stores a list of the ages of the children in the family, see sample data below.

I need to be able to count the ages of children across the index, so using the test data below I need to see...

Aged 1 = 1  
Aged 5 = 1  
Aged 6 = 3  
Aged 10 = 3

I can't find a way to count values by this repeating group. Is it possible to do this?

```auto
PUT test-family-data
{
  "mappings": {
    "properties": {
      "name": {
        "type": "keyword"
      },
      "childrenAges": {
        "type": "integer"
      }
    }
  }
}

POST test-family-data/_doc
{
  "name": "Smith",
  "childrenAges": [5,6,10, 10]
}

POST test-family-data/_doc
{
  "name": "Jones",
  "childrenAges": [1,6, 6, 10]
}

```

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [November 14, 2022, 1:00pm UTC](https://discuss.elastic.co/t/how-to-count-repeated-values-in-kibana/318872/2 "2022-11-14T13:00:19Z")

</div>

Hello @phil_hcs_tech

Maybe this [solution](https://discuss.elastic.co/t/counting-each-key-of-an-array-inside-aggregation/296060) can help you.

---

<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 12, 2022, 1:00pm UTC](https://discuss.elastic.co/t/how-to-count-repeated-values-in-kibana/318872/3 "2022-12-12T13:00:46Z")

</div>

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