# Agg count with range count

**URL:** <https://discuss.elastic.co/t/agg-count-with-range-count/271070>\
**Category:** Elasticsearch\
**Created:** [April 23, 2021, 10:24am UTC](https://discuss.elastic.co/t/agg-count-with-range-count/271070 "2021-04-23T10:24:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charley\_Maillot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charley_maillot/32/87619_2.png) [@Charley\_Maillot](https://discuss.elastic.co/u/Charley_Maillot)\
**Post date:** [April 23, 2021, 10:24am UTC](https://discuss.elastic.co/t/agg-count-with-range-count/271070/1 "2021-04-23T10:24:46Z")

</div>

Hello,

My doc look like

```auto
    {
          "path": "/foo/bar",
          "userId" : "33",
    }

```

I would like to have the number of userId who have more than

1. 100 docs
2. between 50 and 100 docs
3. less than 100 docs

I try to use different aggregation but I don't know how to make range aggregation on the count of another aggregation

Thanks for your help,

---

<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:** [May 21, 2021, 10:25am UTC](https://discuss.elastic.co/t/agg-count-with-range-count/271070/2 "2021-05-21T10:25:30Z")

</div>

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