# Are Conditional Aggregations Possible?

**URL:** <https://discuss.elastic.co/t/are-conditional-aggregations-possible/352518>\
**Category:** Elasticsearch\
**Created:** [February 5, 2024, 10:21am UTC](https://discuss.elastic.co/t/are-conditional-aggregations-possible/352518 "2024-02-05T10:21:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [February 5, 2024, 10:21am UTC](https://discuss.elastic.co/t/are-conditional-aggregations-possible/352518/1 "2024-02-05T10:21:06Z")

</div>

I want to run a count query with an associated aggregation, but only run the aggregation if the count for the query is below a certain number.

Is this possible?

---

<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:** [March 4, 2024, 10:21am UTC](https://discuss.elastic.co/t/are-conditional-aggregations-possible/352518/2 "2024-03-04T10:21:25Z")

</div>

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