Try it free

Reuse a DQL query across dashboard tiles with base queries

  • Latest Dynatrace
  • How-to guide
  • 8-min read
  • Published Oct 20, 2026

A base query is a DQL query that you define once on a dashboard and reuse as the first part of the query in several tiles. Each tile adds its own DQL on top. When you change the base query, every tile that uses it picks up the change.

Use base queries when several tiles start with the same data source command, such as fetch or timeseries, and the same filters. Instead of copying that part into each tile, you maintain it in one place.

How base queries work

  • A base query is stored with the dashboard and is available to all DQL data tiles on it.
  • A tile can use one base query, and the base query is always the first part of the tile query.
  • When the tile runs, Dynatrace appends the tile DQL to the base query and runs the combined query.
  • A base query that no tile uses isn't run when the dashboard loads, so it doesn't add query cost.
  • Anyone who can edit the dashboard can create, edit, and delete its base queries. There's no separate permission.

For example, a base query can fetch and filter the data:

fetch logs
| filter loglevel == "ERROR"

One tile then adds an aggregation on top of it:

| summarize count(), by:{primary_tags.environment}

Another tile adds a different one:

| makeTimeseries count(), by:{log.source}

Create a base query

  1. In the upper-right of the dashboard, open the (Add) menu and select Base query.

    Keyboard shortcut: Shift+B

    A new base query opens in the side panel with a default name such as Base query 1. You can also start from Settings > Base queries and select Add base query.

  2. To rename the base query, select its name at the top of the panel and enter a new one.

  3. Enter the DQL query.

  4. To preview the result, select Run.

    The preview shows the first five records.

  5. Close the side panel to save the base query.

    If the query is invalid, an error appears. Fix it before you use the base query in a tile.

Until a tile uses the base query, the panel shows "This base query isn't used yet", and appears next to it in the Base queries list.

Create a base query from a tile query

If a tile already contains the query that you want to share, you can turn it into a base query.

  1. Edit the DQL tile.

  2. On the Data tab, open the menu of the query editor and select Save as base query.

    Dynatrace copies the whole tile query into a new base query, attaches the base query to the tile, and opens it in the side panel. The base query gets a default name such as Base query 1, which you can change at the top of the panel.

  3. In the query editor of the tile, delete the DQL that's now in the base query, and add DQL that builds on it.

    For example, suppose the tile has this query:

    fetch logs
    | filter status == "ERROR"

    After you select Save as base query, the combined query (base query plus tile query) is:

    fetch logs
    | filter status == "ERROR"
    fetch logs
    | filter status == "ERROR"

    This query isn't valid, so the tile shows an error such as "fetch isn't allowed here". To fix it, delete everything from the tile query and add DQL that builds on the base query, such as:

    | summarize count()

    The combined query is now:

    fetch logs
    | filter status == "ERROR"
    | summarize count()

    The first two lines come from the base query, and the third line comes from the tile query.

Use a base query in a tile

  1. Edit a DQL data tile.

  2. On the Data tab, select Add base query above the query editor, and then choose a base query.

    The list shows how many tiles use each base query. To see the DQL of a base query, hover over it in the list. To create a base query instead, select New base query.

    A Base query box replaces the button. To switch to a different base query later, select it in this box.

  3. In the query editor below, write the DQL that the tile adds to the base query, for example, | summarize count().

  4. To see the combined result, select Run.

To stop using a base query in a tile, open the menu of the Base query box and select Remove. The tile keeps only its own DQL, which usually can't run on its own. Add the missing part back into the tile query, or choose another base query.

Edit a base query

  1. Select Settings > Base queries.

    Base queries that no tile uses show . To see how many tiles use a base query, check the Base query list in any DQL tile.

  2. Select the base query you want to change, or open its menu and select Edit.

  3. Change the query, and then select Run or close the side panel.

    All tiles that use the base query update with the new result.

In the base query editor, variables and query errors work the same way as in the DQL editor of a tile.

Duplicate a base query

To create a copy of a base query, open its menu in the Base queries list and select Duplicate. Tiles that use the original aren't affected.

Delete a base query

  1. Select Settings > Base queries.

  2. In the row of the base query, open the menu and select Delete.

  3. In the Delete base query dialog, select Delete.

    If tiles use the base query, the dialog tells you how many.

The tiles that used the base query keep only their own DQL, so they might show an error or return different results. Check them after you delete the base query.

Limitations

  • Base queries work in DQL data tiles only. You can't use them in variables or annotations.
  • A tile can use only one base query.

Learn more

  • Add data to a dashboard for the basics of adding a DQL query to a tile
  • Add a variable to a dashboard for filtering tiles with variables

Related topics

  • Add data to a dashboard
  • Add a variable to a dashboard
Related tags
Dynatrace Platform