DATTA BI — Drill-down and drill-up
A chart by state answers "where is the problem?" — but the next question is always "and inside the state?". With drill-down, the visual itself answers: double-click a bar and it goes one level down the hierarchy (state → municipality → neighborhood), filtering by the clicked category. Drill-up goes back one level with a click. It all happens inside the card, without leaving the dashboard and without rewriting the query by hand.
How to enable it
Declare the visual's hierarchy — from the most aggregated level to the most detailed — in the drillX field of the visual's channel configuration (bindingsJson):
{
"x": { "column": "uf" },
"y": { "column": "id", "agg": "COUNT" },
"limit": 30,
"drillX": ["uf", "municipio", "bairro"]
}How to use it
- Going down (drill-down): double-click a bar — or another element of the visual. The visual re-renders, filtering by the clicked category and grouping by the next level of the hierarchy.
- Going up (drill-up): a trail appears at the top of the card with the
↑arrow — click it to go back one level. - Back to the start: keep clicking
↑until the root level; the entire dashboard re-renders.
Hands-on example — from state to neighborhood in three clicks
- On a "Beneficiários por UF" visual with the hierarchy
["uf", "municipio", "bairro"], double-click the BA bar. - The visual now shows Bahia's municipalities; a double-click on Salvador goes down to neighborhoods.
- The trail at the top of the card shows the path taken — click
↑to go back to Salvador, and again to return to the by-state view.
How the filter reaches the query
When you go down a level, the platform reuses the visual's saved configuration and overrides only what changed: the axis becomes the next level of the hierarchy and the clicked category is added as an accumulated filter. The override happens on the first-level keys of the configuration — whatever you did not touch keeps applying — and the accumulated filters become a |> WHERE column = "value" AND ... clause in the generated DATTAX query.
The platform also exposes an endpoint that renders a visual with the drill already applied, taking the chosen category and the target level — useful for integrations that build the navigation outside the screen. See the API reference.
Limitations
- Drill-down works on visuals built from a dataset and the axis channels (
datasetId+bindingsJson). Visuals with a handwritten DATTAX script ignore the override and render the script literally. - The maximum depth is the number of levels declared in
drillX. When you try to go past the last level, the visual shows the notice "Nível mais detalhado da hierarquia" (most detailed level of the hierarchy). - Cross-filter (single click) and drill-down (double-click) are independent and work at the same time: the cross-filter applies the filter to every other visual on the dashboard; drill-down changes only the clicked visual.
A ready-made example to explore
The seed-demo-data.sh seed creates the mds-dash-drilldown dashboard with two pre-configured visuals:
- Beneficiários por UF (beneficiaries by state) — hierarchy
["uf", "municipio"]over theds-pessoasdataset. - Gasto por Programa (spending by program) — hierarchy
["programa", "tipo"]over theds-beneficiosdataset.