# Filtering high-cardinality timeseries data by value

**URL:** <https://community.dynatrace.com/t/filtering-high-cardinality-timeseries-data-by-value/55170>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed\
**Created:** [March 3, 2026, 4:39pm UTC](https://community.dynatrace.com/t/filtering-high-cardinality-timeseries-data-by-value/55170 "2026-03-03T16:39:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudolph\_Sedlin](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@Rudolph\_Sedlin](https://community.dynatrace.com/u/Rudolph_Sedlin)\
**Post date:** [March 3, 2026, 4:39pm UTC](https://community.dynatrace.com/t/filtering-high-cardinality-timeseries-data-by-value/55170/1 "2026-03-03T16:39:01Z")

</div>

Hey all.

I have very-high-cardinality timeseries data that I send over to Dynatrace. To prevent the dashboard tiles from crashing and to allow alerting workflows to complete in a timely manner, I use iAny filter statements like “timeseries TPS=avg(TPS\_BY\_DIMENSION), interval:1m, by: dimension | filter iAny(TPS[] \> 10)” to only account for larger and more relevant metrics without filtering directly for specific dimension values. The issue is that iAny is rather slow as it has to scan each and every timeseries by value rather than just once by dimension key like contains() for instance would do, and allows timeseries with just one high value to be admitted into my results. I wonder if other DQL exists that better addresses my need, though I doubt it given all timeseries values would realistically have to be scanned.

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [March 3, 2026, 10:14pm UTC](https://community.dynatrace.com/t/filtering-high-cardinality-timeseries-data-by-value/55170/2 "2026-03-03T22:14:20Z")

</div>

This query will act in similar way:

```markup
timeseries { TPS=avg(TPS_BY_DIMENSION), TPS_MAX=max(TPS_BY_DEMNSION, scalar: true) }, interval:1m, by: {dimension} 
| filter TPS_MAX > 10

```

Can you explain what do you mean exactly "very-high-cardinality timeseries?. Dynatrace metrics are not designed to deal with _**high cardinality dimensions (dimension tuples)**_, which may result in incomplete queries.

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [March 4, 2026, 11:34am UTC](https://community.dynatrace.com/t/filtering-high-cardinality-timeseries-data-by-value/55170/3 "2026-03-04T11:34:01Z")

</div>

Hi,

In practice the most reliable and typically faster alternative to iAny() is to compute a per-series “gate” as a scalar derived from the already computed timeseries array. iAny(TPS[] \> 10) is expensive because it scans the value array for every series and it also admits series with a single spike. Instead I do:

```markup
timeseries TPS = sum(dt.service.request.count, rate: 1m),
  from: -2h, interval: 1m, by: {endpoint.name}
| fieldsAdd TPS_MAX = arrayMax(TPS)
| filter TPS_MAX > 10
| sort TPS_MAX desc
| limit 20

```

 ![scalar1.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/c/6/c6525dc6d9cb159539fbec599fb7243b7bdc7497.jpeg)

This filters on one number per series (max over the full window), without iAny().

I also tested what krzysztof&nbsp;suggest. The scalar:true variant

```markup
timeseries {
  TPS = sum(dt.service.request.count, rate: 1m),
  TPS_MAX = max(dt.service.request.count, rate: 1m, scalar: true)
}, from: -2h, interval: 1m, by: {endpoint.name}
| filter TPS_MAX > 10

```

 ![scalar_empty.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/7/7ad296018342f9c87b874357409dff1f59479250.jpeg)

…but in my environment it returned 0 records, while arrayMax(TPS) worked correctly. It seems scalar:true doesn’t always bind to the by:{…} series as expected (TPS\_MAX ends up NULL per series), so filtering removes everything.

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [March 4, 2026, 12:25pm UTC](https://community.dynatrace.com/t/filtering-high-cardinality-timeseries-data-by-value/55170/4 "2026-03-04T12:25:15Z")

</div>

The reason is different.

_ **iAny** _ as well as _ **arrayMax** _ work on the already calculated results. What I proposed work on detailed data picking max from detailed timeseries.&nbsp;  
It will work identical for timeseries when all available (meaningful)&nbsp; dimensions are listed in _ **by:{}** _. Also when timeseries is aggregated with _**avg()**_, the result may not be very different. But when you use _**sum()**_ and have many dimensions like for&nbsp;dt.service.request.count, the results will be way very different.

---

<div class="post-metadata">

**Author:** ![Rudolph\_Sedlin](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@Rudolph\_Sedlin](https://community.dynatrace.com/u/Rudolph_Sedlin)\
**Post date:** [March 4, 2026, 7:06pm UTC](https://community.dynatrace.com/t/filtering-high-cardinality-timeseries-data-by-value/55170/5 "2026-03-04T19:06:44Z")

</div>

Pretty much exactly that, while I have some metrics that are low-cardinality, others have hundreds of thousands of metrics each minute due to a high granularity (dimension tuples with many fields) and high throughput, which certainly stresses the Dynatrace metrics ingest and Davis.
