You can use Metabase’s notebook editor to create questions with explorable charts. People can then click on values in the chart to pull up an Action menu, which will give them different options to drill through the chart’s data.
- The different ways you can ask questions of your data in Metabase
- An example question composed with the notebook editor
- The Action menu
- Zoom in
- View these records
- Custom destinations and cross-filtering
The Action menu’s drill-through functionality is only available for certain question types, so let’s review those now.
The different ways you can ask questions of your data in Metabase
There are three different ways to ask questions in Metabase.
All methods share the same visualization features, but only simple and custom questions can provide the Action menu with the auto-generated drill-through functionality.
|Question type||Description||Action menu?|
|Simple Question||Pick some data, view it, and easily filter, summarize, and visualize it.||YES|
|Custom Question||Use the advanced notebook editor to join data, create custom columns, do math, and more.||YES|
|Native Query||For more complicated questions, you can write your own SQL or native query.||NO|
The reason that the Action menu is only available for simple and custom questions is because the functionality leverages metadata about your tables and columns. Under the hood, simple and custom questions use the same query building primitives (grouping functions, filtering functions, and so on). In fact, simple and custom questions share a continuum; you can start with a simple question to explore the data (affectionately known as Chill Mode in Metabase), then customize that question with the notebook editor. For even more advanced questions, you have the awesome power of custom expressions at your disposal.
If you prefer SQL (or you want to take advantage of Metabase’s SQL snippets feature), you can take questions composed in the notebook editor, and convert them to SQL at any time (figure 3).
SQL questions give a lot more freedom of expression — you have all of SQL at your disposal — but you lose the tight coupling with the metadata that makes drill-through possible.
An example question composed with the notebook editor
Let’s tour the drill-through functionality available in the Action menu. If you’d like to follow along, see figure 4 for a screenshot of the question in the notebook editor. The visualization has been set to a stacked bar chart (figure 5).
The Action menu
Clicking on a value in your chart presents an Action menu with the different drill-through options you can take to explore your data.
We’ll step through each of the options in the popup menu you see above:
Select to zoom
You can click and drag to select an area of a chart to zoom in on.
You can left-click to bring up the action menu, and select Zoom in and Metabase will create a “close-up” of the data surrounding the value you selected.
The Zoom in option in the action menu will choose an appropriate range of values based on the full range of values in the chart. As shown in figure 9, Zoom in also focuses on the clicked category, so only orders with products in the Doohickey category are shown. If you’d prefer a different range, or wish to include additional groups, you have the notebook editor available to fine tune your chart (and save it as a new question).
View these records
You can click on a value on a chart and select the View these orders option to bring up a table with the individual records that compose the value.
Break out by a category — this option lets us do things like see the banana cream pie orders in June 2017 broken out by the status of the customer (e.g., new or VIP, etc.) or other different aspects of the order. Different charts will have different breakout options, such as Location and Time.
Figure 11 shows an example breakout looking at orders from
X-rays are auto-magic explorations of your data. You can click anywhere on a chart to perform an X-ray, and Metabase will generate a dashboard full of different questions about the data. You’ll have an option to save that X-ray as a dashboard, which you can then edit to your liking, by removing irrelevant questions, or adding new questions or text boxes to fill in the story you want to tell.
Clicking on a point or a bar additionally gives you the option to compare data, which will give you another dashboard with auto-generated charts.
Call to Action menu
Drill-through is a great way to give viewers of your questions more insight into their data, which makes it an excellent feature for delivering self-service, embedded analytics.
But drill-through is also an excellent tool for exploring your data, especially when you’re starting out with a new dataset and you’re not sure what questions you should be asking. Start with a broad query, then experiment with the options on the Action menu. When you discover an insightful cut of the data, save it as a new question, and fine tune the visualization as needed, or convert it a SQL question if you’re more comfortable with code.
Custom destinations and cross-filtering
When working with dashboards, the Action menu isn’t your only option. On dashboards, you can replace the Action menu with a custom destination. Custom destinations are particularly useful if you wrote your question in SQL and don’t benefit from the Action menu.
You can also set up crossing-filtering on a dashboard, so that people can click on a chart to update a filter.