# How to consolidate data into a sum within timeseries

**URL:** <https://community.dynatrace.com/t/how-to-consolidate-data-into-a-sum-within-timeseries/56609>\
**Category:** DQL\
**Tags:** dql\
**Created:** [July 31, 2026, 8:51am UTC](https://community.dynatrace.com/t/how-to-consolidate-data-into-a-sum-within-timeseries/56609 "2026-07-31T08:51:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hillman](https://avatars.discourse-cdn.com/v4/letter/h/439d5e/32.png) [@Hillman](https://community.dynatrace.com/u/Hillman)\
**Post date:** [July 31, 2026, 8:51am UTC](https://community.dynatrace.com/t/how-to-consolidate-data-into-a-sum-within-timeseries/56609/1 "2026-07-31T08:51:37Z")

</div>

Currently I am use the following DQL to list out the web request count for our API calls:

```markup
timeseries { sum(webrequest) }, by: { http.response.status_code, server.address, TenantID, Tenant, url.path }
| fieldsAdd Tenant = if (tolong(TenantID) == 6, "Singapore")
| fieldsAdd Tenant = if (tolong(TenantID) == 7, "Australia", else:Tenant)
| fieldsAdd Tenant = if (tolong(TenantID) == 8, "Philippine", else:Tenant)
| fieldsAdd Tenant = if (tolong(TenantID) == 9, "Malaysia", else:Tenant)
| fieldsAdd Tenant = if (tolong(TenantID) == 10, "Thailand", else:Tenant)
| fieldsAdd Tenant = if (tolong(TenantID) == 11, "Hong Kong", else:Tenant)
| fieldsAdd Tenant = if (tolong(TenantID) == 13, "Indonesia", else:Tenant)
| fieldsAdd Tenant = if (tolong(TenantID) == 14, "Vietnam", else:Tenant)
| fieldsAdd Tenant = if (tolong(TenantID) == 15, "New Zealand", else:Tenant)
| fieldsAdd Tenant = if (tolong(TenantID) == 22, "CDM", else:Tenant)
| filterOut isNull(Tenant)
| filter http.response.status_code >= 404 and http.response.status_code <= 599
| filter matchesValue(server.address, "abc.com")
| fieldsRemove server.address

```

However, I have found there are quite a few of API calls which involve individual membership numbers:

 ![Hillman_0-1785486983380.png](https://global.discourse-cdn.com/dynatrace/original/2X/b/b79ec5f7a9752baf5aa0fede39ed44ff05f67475.png)

I try to use DQL to remove the membership number from the URL:

```markup
| fieldsAdd URL = url.path
| fieldsAdd URL = if(
      matchesValue(url.path, "*/memberships/*"),
      concat(
         splitString(url.path, "/memberships/")[0],
         "/memberships"
      ),
      else: URL
  )

```

However, the resultant data end up look this:

 ![Hillman_0-1785724510428.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/261978eac140c9ff97aa50b4c5f98f9f2f7d86d9.png)

Is there any way I can sum up the URL request count and consolidate /memberships into a single entry?

---

<div class="post-metadata">

**Author:** ![marina\_pollehn](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marina_pollehn/32/39120_2.png) [@marina\_pollehn](https://community.dynatrace.com/u/marina_pollehn)\
**Post date:** [August 3, 2026, 9:00am UTC](https://community.dynatrace.com/t/how-to-consolidate-data-into-a-sum-within-timeseries/56609/2 "2026-08-03T09:00:03Z")

</div>

Can I ask how you are currently monitoring the API? Are you monitoring it as a regular service? Is it showing up when you open the Services app?

Then I would suggest to use URL cleaning rules. Go to your Services app, select your service, go to it’s settings via the three dots […] and then select Request Naming Rules. You could write&nbsp; the cleaning rules also globally but here I only do it for the specific service.

Start with the clean URL rules where you can also use regex to get the numbers/ids out. After, if you want, you can also use the new (shortened without IDs/numbers) URL for your request naming by writing request naming rules below.

 ![marina_pollehn_0-1785747517268.png](https://global.discourse-cdn.com/dynatrace/original/2X/9/9d2842f1e3692b1658a3a96325362011381e5e15.png)

A RegEx like:&nbsp;^.\*?\/memberships&nbsp; &nbsp; could capture everything before and including /memberships and remove everything after.

But I think you might be following a different approach to monitor it? I can’t fully reproduce the data in my playground quickly, but I think the issue is that you never remove the old url.path variable. If you remove it, DQL can no longer split the sum up even more by using url.path, which will give you more aggregated values.

So I would include this as a last step, after the last line of DQL you have shared.

```markup
| fieldsRemove url.path

```

If this is not working, let me know, then I will put some effort into reproducing your data.

---

<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:** [August 3, 2026, 6:19pm UTC](https://community.dynatrace.com/t/how-to-consolidate-data-into-a-sum-within-timeseries/56609/3 "2026-08-03T18:19:45Z")

</div>

Try to remove the url.path field at the end of your DQL.

---

<div class="post-metadata">

**Author:** ![Hillman](https://avatars.discourse-cdn.com/v4/letter/h/439d5e/32.png) [@Hillman](https://community.dynatrace.com/u/Hillman)\
**Post date:** [August 5, 2026, 4:00am UTC](https://community.dynatrace.com/t/how-to-consolidate-data-into-a-sum-within-timeseries/56609/4 "2026-08-05T04:00:33Z")

</div>

[@marina\_pollehn](https://community.dynatrace.com/user/2456),&nbsp;[@dannemca](https://community.dynatrace.com/user/18264)&nbsp; I have created an Open Pipeline and retrieving the data from spans. I have tried with removing the field url.path and it works as expected. Thank you for your help!
