# How to get the completness of each column by group

**URL:** <https://discuss.elastic.co/t/how-to-get-the-completness-of-each-column-by-group/283542>\
**Category:** Elasticsearch\
**Created:** [September 7, 2021, 1:51pm UTC](https://discuss.elastic.co/t/how-to-get-the-completness-of-each-column-by-group/283542 "2021-09-07T13:51:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelg/32/78690_2.png) [@MichaelG](https://discuss.elastic.co/u/MichaelG)\
**Post date:** [September 7, 2021, 1:51pm UTC](https://discuss.elastic.co/t/how-to-get-the-completness-of-each-column-by-group/283542/1 "2021-09-07T13:51:49Z")

</div>

I'm trying to get the completeness of every column grouped by a categorical field that know to be 100% complete.

Currently I'm able to get the completeness for any given column, grouped by the grouping field like this:

```auto
{
  "size": 0,
  "aggs": {
    "where_field_I_want": {
      "filter": {
        "exists": {
          "field": "field_I_want"
        }
      },
      "aggs" : {
        "group_by_field_to_group_by": {
          "terms": {
            "field": "field_to_group_by",
            "order": { "_term" : "asc" },
            "size": 1000
          }
        }
      }
    }
  }
}

```

Is there any easy way to get the count of every column? I tried adding a second filter\>exists\>field but it didn't work.

---

<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 5, 2021, 1:52pm UTC](https://discuss.elastic.co/t/how-to-get-the-completness-of-each-column-by-group/283542/2 "2021-10-05T13:52:21Z")

</div>

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