# How to join two timeseries in a single DQL to map/alias an GUID to Readable Name

**URL:** <https://community.dynatrace.com/t/how-to-join-two-timeseries-in-a-single-dql-to-map-alias-an-guid-to-readable-name/52932>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed\
**Created:** [August 13, 2025, 12:29pm UTC](https://community.dynatrace.com/t/how-to-join-two-timeseries-in-a-single-dql-to-map-alias-an-guid-to-readable-name/52932 "2025-08-13T12:29:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raul\_rrr](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@Raul\_rrr](https://community.dynatrace.com/u/Raul_rrr)\
**Post date:** [August 13, 2025, 12:29pm UTC](https://community.dynatrace.com/t/how-to-join-two-timeseries-in-a-single-dql-to-map-alias-an-guid-to-readable-name/52932/1 "2025-08-13T12:29:51Z")

</div>

I have created a dashboard to monitor multiple MuleSoft API metrics ( Response Time, Endpoint Usage, Request Count). Each tile contains respective DQL query that includes the dimension `request_attribute.Client-Id` in GUID format.

For example, when a&nbsp; API request occurs, Dynatrace automatically captures the API name, endpoint, and also records the Client ID in `request_attribute.Client-Id`. For dashboard filtering and data splitting, we require three key details: API name, endpoint, and client ID (The API request header does not have Client Name, so we capture ID in request attribute).

```markup
timeseries {
value = sum(service.muleapi.response.count)
},
by: {dt.entity.service, endpoint.name, `request_attribute.Client-Id`},

```

Separately, I have a custom metric (`custom.api.metric`) ingested via the Dynatrace API, which contains the mapping of `clientid` (GUID) to `clientname` (two columns).

```markup
timeseries testmetric = sum(custom.api.metric), by: { clientid, clientname }

```

Within a single DQL query for a tile, I want to:

1. Fetch the main metric (e.g., API Response Time) as a timeseries.  
2. Fetch the `custom.testmetric` as a timeseries.  
3. Match `request_attribute.Client-Id` from the main metric with `clientid` from `custom.api.metric`.  
4. Dynamically alias or replace the GUID with the corresponding `clientname`.

Is there a way to join these two timeseries results within a single query, so I can achieve this aliasing/mapping without hardcoding as a lookup data record[] table?

---

<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:** [August 13, 2025, 1:52pm UTC](https://community.dynatrace.com/t/how-to-join-two-timeseries-in-a-single-dql-to-map-alias-an-guid-to-readable-name/52932/2 "2025-08-13T13:52:31Z")

</div>

This is how to combine results of these 2 queries (from 2nd I take only clientname):

```markup
timeseries { value = sum(service.muleapi.response.count)},
by: {dt.entity.service, endpoint.name, `request_attribute.Client-Id`}
| lookup [
  timeseries testmetric = sum(custom.api.metric), by: { clientid, clientname }
], sourceField:`request_attribute.Client-Id`, lookupField:clientid, fields:{clientname}

```

Just 2 additional comment from my side:

- I hope that there is limited set of client IDs. Grail is quite capable, but everything has limits and crossing them may have some consequences (e.g. too much data points may result in inability of long term analysis). You can check details here:&nbsp;[Limits for Metrics — Dynatrace Docs](https://docs.dynatrace.com/docs/analyze-explore-automate/metrics/limits)
- Query will provide aliases/mapping as long as in timeframe of the inner query mapping was provided. As metrics are not kept forever you probably will need to re-ingest mappings regularly. There is new functionality released recently to keep such mappings, which may be more optimal for this use-case:&nbsp;[Lookup data in Grail — Dynatrace Docs](https://docs.dynatrace.com/docs/discover-dynatrace/platform/grail/lookup-data)
