# Hoow to use range or filter aggragations in transforms

**URL:** <https://discuss.elastic.co/t/hoow-to-use-range-or-filter-aggragations-in-transforms/215755>\
**Category:** Kibana\
**Created:** [January 20, 2020, 2:38pm UTC](https://discuss.elastic.co/t/hoow-to-use-range-or-filter-aggragations-in-transforms/215755 "2020-01-20T14:38:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjilinga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anjilinga/32/86010_2.png) [@anjilinga](https://discuss.elastic.co/u/anjilinga)\
**Post date:** [January 20, 2020, 2:38pm UTC](https://discuss.elastic.co/t/hoow-to-use-range-or-filter-aggragations-in-transforms/215755/1 "2020-01-20T14:38:27Z")

</div>

In Transforms, range and filter aggragations are not supported. can some one please suggest how to use these aggregations in transforms.

---

<div class="post-metadata">

**Author:** ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)\
**Post date:** [January 21, 2020, 8:04am UTC](https://discuss.elastic.co/t/hoow-to-use-range-or-filter-aggragations-in-transforms/215755/2 "2020-01-21T08:04:01Z")

</div>

Hi Anji,

thanks for the feedback. Transform is limited to certain aggregations, however we are adding support for more aggregations over time. For your case I suggest to take a look at scripted metric, using a script you can workaround this limitation, the [examples](https://www.elastic.co/guide/en/elasticsearch/reference/master/transform-examples.html) contain similar problems. I think `filter` and `range` should not be to hard to implement as script.

If the `filter` applies to all aggregations you can apply a filter in the query.

---

<div class="post-metadata">

**Author:** ![anjilinga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anjilinga/32/86010_2.png) [@anjilinga](https://discuss.elastic.co/u/anjilinga)\
**Post date:** [January 21, 2020, 5:27pm UTC](https://discuss.elastic.co/t/hoow-to-use-range-or-filter-aggragations-in-transforms/215755/3 "2020-01-21T17:27:00Z")

</div>

Thanks Hendrik,

Yes i have used metric script in pivot script and got the results.

---

<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:** [February 18, 2020, 5:27pm UTC](https://discuss.elastic.co/t/hoow-to-use-range-or-filter-aggragations-in-transforms/215755/4 "2020-02-18T17:27:19Z")

</div>

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