# Easily convert Data explorer queries to dql for Dashboards, Notebooks and other apps

**URL:** <https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007>\
**Category:** Dynatrace Tips\
**Tags:** dynatrace-managed, data-explorer, grail, dashboards, tips-and-tricks\
**Created:** [February 7, 2024, 8:50am UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007 "2024-02-07T08:50:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawid\_rampalski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dawid_rampalski/32/6015_2.png) [@dawid\_rampalski](https://community.dynatrace.com/u/dawid_rampalski)\
**Post date:** [February 7, 2024, 8:50am UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007/1 "2024-02-07T08:50:29Z")

</div>

### Why do I see differences in metric data between grail based queries and Data explorer?

With grail we have changed the way the data is stored and displayed. DQL allows you to access raw metric data and perform your own transformations to achieve what you want. In case of Data explorer it already does some processing on the data in the background. When trying to play around with timeseries in our new platform you might notice that metric results that you get differ from what you can see in Data explorer - this is most likely due to different processing applied by your query and by Data explorer

### How do I get the same results?

To make transition from our classic Data explorer charts easier we have built a tool that will allow you to create a traditional metric query and automatically generate equivalent DQL command.

In Data explorer build your metric query:

 ![dawid_rampalski_0-1707294491848.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/e/1e586af149cbaf1c72afa66ccc3b80574446ee08.png)

To transform it into dql, click on the “Open with” and select your application of choice:

![dawid_rampalski_1-1707294975016.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/a10737f89db02fad3d808a6bac277d592a8e726c.png)

 ![dawid_rampalski_2-1707295001837.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/49311b9d5aa5a20f673466f97de7693a8f3658e5.png)

Your query is generated in selected app together with a tile that runs it for you and presents results:

 ![dawid_rampalski_3-1707295805465.png](https://global.discourse-cdn.com/dynatrace/original/2X/6/6f12d39cce1e0e0cfd2d3ec307178219c64e0629.png)

```markup
timeseries usage=sum(dt.process.cpu.usage, rollup: avg), filter: { in(dt.entity.process_group_instance, classicEntitySelector("type(process_group_instance),fromRelationship.isProcessOf(type(HOST),entityName.equals(\"cpu1-demo1\"))")) }
| sort arraySum(usage) desc
| limit 20
| append [timeseries usage=avg(dt.host.cpu.usage), filter: { in(dt.entity.host, classicEntitySelector("type(host),entityName.equals(\"cpu1-demo1\")")) }
  | sort arrayAvg(usage) desc
  | limit 20]

```

This query is designed to provide the same processing that is selected in Data explorer or get as close to it as possible within DQL

---

<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 7, 2024, 7:27pm UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007/2 "2024-02-07T19:27:11Z")

</div>

That’s an interesting feature!!!

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [February 27, 2024, 6:59pm UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007/3 "2024-02-27T18:59:23Z")

</div>

Great!!! Thanks. Very Useful

---

<div class="post-metadata">

**Author:** ![sujit\_k\_singh](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@sujit\_k\_singh](https://community.dynatrace.com/u/sujit_k_singh)\
**Post date:** [February 28, 2024, 4:16am UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007/4 "2024-02-28T04:16:19Z")

</div>

Ahh..thats awesome… very useful. Thanks for sharing this

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [April 12, 2024, 5:25am UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007/5 "2024-04-12T05:25:35Z")

</div>

Hi&nbsp;[@dawid\_rampalski](https://community.dynatrace.com/user/3493)&nbsp;,

In several cases we find this message when we try to convert a query from Data Explorer to DQL:

 ![erh_inetum_0-1712898792825.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/3/730fba10e812781500b498485cb633b4b80c2e3b.png)

Is it because there is not an equivalent metric for DQL?

The Data Explorer query that we can´t convert is using the following metrics:

- builtin:apps.web.actionCount.load.browser
- builtin:apps.web.actionCount.xhr.browse
- builtin:apps.web.visuallyComplete.load.browse
- builtin:apps.web.VisuallyComplete.xhr.browse

In these cases, how can we convert the DataExplorer query to DQL query?

Thanks in advance,

Elena.

---

<div class="post-metadata">

**Author:** ![dawid\_rampalski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dawid_rampalski/32/6015_2.png) [@dawid\_rampalski](https://community.dynatrace.com/u/dawid_rampalski)\
**Post date:** [April 12, 2024, 5:38am UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007/6 "2024-04-12T05:38:04Z")

</div>

Hi Elena,

that is exactly the reason why. We don’t have metrics for applications enabled yet in Grail. You can check the list of currently available builtin metrics here:&nbsp;[Built-in Metrics on Grail — Dynatrace Docs](https://docs.dynatrace.com/docs/observe-and-explore/metrics/built-in-metrics-on-grail).

In the case of those there is at this point no way to use them from DQL. We are working on it though 🙂

Best Regards,  
Dawid

---

<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:** [April 12, 2024, 6:48am UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007/7 "2024-04-12T06:48:24Z")

</div>

Thank you, this is a great help!

---

<div class="post-metadata">

**Author:** ![cesarsaravia](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/cesarsaravia/32/12818_2.png) [@cesarsaravia](https://community.dynatrace.com/u/cesarsaravia)\
**Post date:** [April 19, 2024, 5:51pm UTC](https://community.dynatrace.com/t/easily-convert-data-explorer-queries-to-dql-for-dashboards-notebooks-and-other-apps/44007/8 "2024-04-19T17:51:34Z")

</div>

Very useful tip!!
