Dashboards and reports

Drilldowns

A drilldown is what happens when someone clicks a chart: a bar, a slice, a point, a table row or a KPI card. It either opens the rows behind that number, swaps the chart for a more detailed one, or jumps to another tab or dashboard with filters already set. This page covers all three, the ${column} template variables, and worked examples.

The three kinds

KindYou writeWhat the viewer gets
Modal tableA query in drilldown_dslA dialog with the detail rows (or a chart) for what they clicked. This is the default.
Inline chainA list of queries and drilldown_mode: inlineThe chart is replaced in place, level by level, with a breadcrumb to go back.
Navigationnavigate(...) in drilldown_dslA switch to another tab or dashboard, with the clicked value applied as a filter. No query runs.

A chart without drilldown_dsl is not clickable. solidafy validate and solidafy pipelines push treat a missing drilldown as an error, so give every chart one.

Which charts are clickable

Bar, line and timeseries, area, pie and donut, scatter, bubble, band, waterfall, leaderboard, sankey and flow charts, table rows, and KPI cards. Radar, heatmap, boxplot, gauge and funnel charts do not respond to clicks.

Template variables

Inside a drilldown query, ${column} is replaced with the clicked row's value for that column:

yaml
drilldown_dsl: |
  source("gh.pr_enriched")
    .since(opened_at, "90d")
    .filter(team == "${team}")
    .sort([opened_at: desc])
    .select([display_name, team, repo, pr_title, opened_at])

Things to know:

  • The value is inserted as-is. Write the quotes yourself for text: team == "${team}". Leave them off for numbers: pr_number == ${pr_number}.
  • The column must be in the clicked row. For a bar chart that is the x column and the y values. For a chart with series, the series column is added too, so ${team} works on a chart with series: team. For a table, any column in the row. For a flow chart, only the node id column (x).
  • A missing value becomes an empty string. If the clicked row has no team column, team == "${team}" turns into team == "" and the drilldown finds nothing. Match the variable to what the chart groups by.
  • KPI cards have no row to click. ${value} is the KPI's current number and every other variable is empty, so a KPI drilldown usually shows the top records behind the number rather than filtering on a clicked value.
  • ${...} only works in drilldowns. In a chart's own dsl there is no clicked row, and solidafy validate flags it. Use a filter placeholder ([%name%]) there instead.
ChartVariables you can use
Bar, line, area, waterfall${x_column}, plus ${series_column} when the chart has a series
Pie, donut${series_column} (the slice label)
Scatter, bubble${series_column} and the other columns of the point
Table${any_column} in the clicked row
Leaderboard, sankeyAny column of the clicked row (${source}, ${target} for sankey)
KPI${value}

The default. The click opens a dialog that runs the drilldown query and shows the result:

  • If the query ends in .chart(...), the dialog shows that chart.
  • Otherwise it shows a table, 100 rows per page, with Search this page... and an Export all rows as CSV button. The dialog does its own paging, so any .limit(...) in the query is replaced by that paging.

Write modal drilldowns so the rows explain the number that was clicked:

  • Filter on the same thing the chart groups by.
  • Sort by something meaningful, usually newest first or largest first.
  • Select columns a person can read: names, titles, dates and the key metrics, not internal ids.
yaml
- name: prs_by_team
  title: PRs by team
  tab: Overview
  grid: { x: 0, y: 0, w: 6, h: 4 }
  dsl: |
    source("gh.pr_enriched", time: opened_at)
      .since(@time, "[%time_range%]")
      .group_by([team])
      .agg([count() as prs])
      .chart(bar, x: team, y: prs)
  drilldown_dsl: |
    source("gh.pr_enriched")
      .since(opened_at, "[%time_range%]")
      .filter(team == "${team}")
      .sort([opened_at: desc])
      .select([display_name, repo, pr_title, was_merged, cycle_time_hours, opened_at])

A modal only ever runs the first drilldown query. To walk several levels, use an inline chain.

Inline chains

Give drilldown_dsl a list and set drilldown_mode: inline. Entry 0 runs on the first click, entry 1 on a click inside the result of entry 0, and so on. When the list runs out, the chart stops being clickable. A breadcrumb in the widget header takes the viewer back up.

yaml
- name: prs_by_team
  title: PRs by team
  tab: Overview
  grid: { x: 0, y: 4, w: 12, h: 5 }
  drilldown_mode: inline
  dsl: |
    source("gh.pr_enriched", time: opened_at)
      .since(@time, "[%time_range%]")
      .group_by([team])
      .agg([count() as prs])
      .chart(bar, x: team, y: prs)
  drilldown_dsl:
    - |
      source("gh.pr_enriched")
        .since(opened_at, "[%time_range%]")
        .filter(team == "${team}")
        .group_by([display_name])
        .agg([count() as prs])
        .chart(bar, x: display_name, y: prs)
    - |
      source("gh.pr_enriched")
        .since(opened_at, "[%time_range%]")
        .filter(display_name == "${display_name}")
        .sort([opened_at: desc])
        .select([display_name, repo, pr_title, opened_at])

${...} at each level is filled from the row clicked at that level. In the example, level 1 sees display_name from the level-0 bar chart, not the original team. If a later level also needs team, make sure the earlier level returns it (here, group by [team, display_name]).

The drill position belongs to the widget. Switching tabs or leaving the dashboard resets it.

A single string in drilldown_dsl behaves like a list with one entry: one level of drilling, then the chart stops responding.

navigate(...) moves the viewer instead of running a query:

yaml
# Same dashboard: switch to the Releases tab and filter by the clicked team
drilldown_dsl: |
  navigate(tab: "Releases").filter(team == "${team}")
yaml
# Another dashboard: open its "Stuck Now" tab with two filters set
drilldown_dsl: |
  navigate(dashboard: "d0570e16-6943-4427-a3a0-120b9d08eee1", tab: "Stuck Now")
    .filter(team == "${team}")
    .filter(severity in ["high", "critical"])

Rules:

  • tab: is required. It is matched case-insensitively, ignoring surrounding spaces.
  • dashboard: is optional and must be the target dashboard's id (a UUID, shown by solidafy dashboard list). Leave it out to stay on the current dashboard.
  • Only .filter(...) may follow navigate(...). No .select(), .agg(), .chart() and so on.
  • Filters may only use == or in [...]. != and not in are rejected.
  • Each filter is matched to a filter on the destination by its column, its variable, or its label in snake case. Filters that match nothing on the destination are skipped silently.

Because navigation sets real dashboard filters, a same-dashboard jump updates the URL (?tab=...&f.team=Checkout), so the viewer can share or bookmark the result. The chips that were just set flash briefly so it is clear what changed.

navigate(...) can also be an entry in an inline chain. It navigates regardless of the depth or mode.

solidafy test checks navigation drilldowns structurally only, since there is no query to run.

Filters inside drilldowns

Dashboard filters apply to drilldown queries exactly as they apply to charts: [%name%] placeholders are filled in and injection filters are added (see Filters). So a drilldown can follow the dashboard's time range:

yaml
drilldown_dsl: |
  source("gh.pr_enriched")
    .since(opened_at, "[%time_range%]")
    .filter(team == "${team}")
    .filter(region == "[%region%]")
    .sort([opened_at: desc])
    .select([display_name, team, repo, pr_title, opened_at])

The same rules apply as for charts: keep joins in a preamble and the final statement free-standing, so injected filters land after the columns exist.

More examples

Donut, by slice:

yaml
dsl: |
  source("gh.pr_enriched", time: opened_at)
    .since(@time, "[%time_range%]")
    .group_by([status])
    .agg([count() as prs])
    .chart(donut, y: prs, series: status)
drilldown_dsl: |
  source("gh.pr_enriched")
    .since(opened_at, "[%time_range%]")
    .filter(status == "${status}")
    .sort([opened_at: desc])
    .select([display_name, repo, pr_title, status, opened_at])

Scatter, by point (one dot per engineer):

yaml
dsl: |
  source("gh.pr_enriched", time: opened_at)
    .since(@time, "[%time_range%]")
    .filter(was_merged == 1)
    .group_by([display_name, team])
    .agg([round(avg(additions + deletions), 0) as avg_size, round(avg(cycle_time_hours), 1) as avg_cycle])
    .chart(scatter, x: avg_size, y: avg_cycle, series: display_name)
drilldown_dsl: |
  source("gh.pr_enriched")
    .since(opened_at, "[%time_range%]")
    .filter(display_name == "${display_name}" and was_merged == 1)
    .sort([cycle_time_hours: desc])
    .select([repo, pr_title, additions, deletions, cycle_time_hours, opened_at])

KPI, showing what is behind the number:

yaml
dsl: |
  source("gh.pr_enriched", time: opened_at)
    .since(@time, "[%time_range%]")
    .filter(state == "open")
    .agg([count() as n])
    .chart(kpi, y: n, title: "Open PRs")
drilldown_dsl: |
  source("gh.pr_enriched")
    .filter(state == "open")
    .sort([opened_at: asc])
    .select([display_name, repo, pr_title, opened_at])

Table row:

yaml
drilldown_dsl: |
  source("gh.pr_enriched")
    .since(opened_at, "[%time_range%]")
    .filter(display_name == "${display_name}")
    .sort([opened_at: desc])
    .select([repo, pr_title, was_merged, cycle_time_hours, opened_at])

KPI that jumps to a detail tab:

yaml
drilldown_dsl: |
  navigate(tab: "Deploy Detail")

Common mistakes

MistakeWhat happens
drilldown_dsl: "" or drilldown_dsl: []Treated as no drilldown: the chart is not clickable, and solidafy validate reports the drilldown as missing.
${col} names a column the clicked row does not haveThe value becomes empty and the filter matches nothing.
A list of queries without drilldown_mode: inlineThe modal only runs the first entry.
result = source(...) as the last lineNo output. The last statement must be free-standing.