# Current request count vs baseline

**URL:** <https://community.dynatrace.com/t/current-request-count-vs-baseline/55011>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, slo\
**Created:** [February 16, 2026, 3:01pm UTC](https://community.dynatrace.com/t/current-request-count-vs-baseline/55011 "2026-02-16T15:01:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![OnkarShinde](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@OnkarShinde](https://community.dynatrace.com/u/OnkarShinde)\
**Post date:** [February 16, 2026, 3:01pm UTC](https://community.dynatrace.com/t/current-request-count-vs-baseline/55011/1 "2026-02-16T15:01:18Z")

</div>

I am trying to create a DQL to measure the current request count as percentage of the baseline. I intend to use it in an SLO configuration.

I tried something like this:

timeseries { today=sum(dt.service.request.count),by: { dt.entity.service }, interval:1m}  
| append [timeseries {yesterday=sum(dt.service.request.count),by: { dt.entity.service }, shift:-24h, interval:1m}]  
| filter dt.entity.service==“SERVICE-ABC”  
| fieldsAdd sli=((today[]/yesterday[])\*(100))

But this gives me just one data point and not a time series.

I also looked into the documentation but can not find any details on how to achieve this.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [February 16, 2026, 6:30pm UTC](https://community.dynatrace.com/t/current-request-count-vs-baseline/55011/2 "2026-02-16T18:30:46Z")

</div>

Good day,&nbsp;[@OnkarShinde](https://community.dynatrace.com/user/72218)

Try to replace the append by lookup instead.

```markup
timeseries { today=sum(dt.service.request.count),by: { dt.entity.service }, interval:1m}
| lookup [ timeseries {yesterday=sum(dt.service.request.count)
          ,by: { dt.entity.service }, shift:-24h, interval:1m} ] , sourceField:dt.entity.service, lookupField:dt.entity.service
| filter dt.entity.service=="SERVICE-ABC"
| fieldsAdd sli=((today[]/lookup.yesterday[])*(100))

```

Try and let us know.

---

<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:** [February 17, 2026, 12:59pm UTC](https://community.dynatrace.com/t/current-request-count-vs-baseline/55011/3 "2026-02-17T12:59:28Z")

</div>

Hi,  
The issue is that append stacks rows from the subquery; it doesn’t place yesterday into the same record as today. So you end up dividing values that usually don’t coexist in one row, which effectively collapses to a single meaningful point (or mostly nulls).&nbsp;Use a join.  
Try this:

```markup
timeseries today = sum(dt.service.request.count, default: 0),
         by: { dt.entity.service },
         interval: 1m
| filter dt.entity.service == "SERVICE-076EAECF9109883D"
| join on: { dt.entity.service, interval }, [
    timeseries yesterday = sum(dt.service.request.count, default: 0),
             by: { dt.entity.service },
             shift: -24h,
             interval: 1m
  ], fields: { yesterday }
| fieldsAdd sli = if(yesterday[] == 0, 0, else: (today[] / yesterday[]) * 100)

```

 ![t_pawlak_0-1771333150005.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/b/3b54b5e7f34b3a7f5c5a707691def7c29605d316.png)

---

<div class="post-metadata">

**Author:** ![OnkarShinde](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@OnkarShinde](https://community.dynatrace.com/u/OnkarShinde)\
**Post date:** [February 25, 2026, 12:19pm UTC](https://community.dynatrace.com/t/current-request-count-vs-baseline/55011/4 "2026-02-25T12:19:22Z")

</div>

Should the last line be changed to?

fieldsAdd sli = if(yesterday[] == 0, **100** , else: (today[] / yesterday[]) \* 100)

If there were no requests yesterday why should the SLI be considered 0, I would rather consider them 100? The intent is to detect the drop in the requests, don’t care if there is increase compared to yestertday

---

<div class="post-metadata">

**Author:** ![OnkarShinde](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@OnkarShinde](https://community.dynatrace.com/u/OnkarShinde)\
**Post date:** [February 25, 2026, 3:20pm UTC](https://community.dynatrace.com/t/current-request-count-vs-baseline/55011/5 "2026-02-25T15:20:54Z")

</div>

I tried to use this in a notebook. But when I try to validate my anomaly detection settings with this query it is not working. The query below with join is working for me.
