Data and Business Intelligence Glossary Terms

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
V
W
X

Query builder

What is the query builder?

In Metabase, the query builder is the graphical interface for asking questions.

If you aren’t a SQL person or just prefer to analyze your data using buttons and dropdowns instead of code, the query builder’s got you covered. And if you aren’t exactly sure what you’re trying to figure out about that data, those buttons and dropdowns can give you some ideas, like listing options for the filters and groupings you can add to your starting table, model, or saved question.

Asking questions with Metabase’s query builder

There are a couple ways you can use the query builder to ask questions about your data:

  1. Start from the data browser. Add filters and summarizations using the sidebars to the right of your data visualization.

  2. Create your question from scratch using the query builder interface. The query builder offers more flexibility for constructing a question: in addition to the regular filtering and summarization options, you can use custom expressions to create more sophisticated filters and aggregations. You can also join tables, create custom columns, and preview your results at each step before visualizing the final product.

These paths aren’t mutually exclusive — you can start in the data browser, visualize your data, use the sidebars to tweak your question, open the query builder to make additional changes, and so on.

Example: using the query builder

We’ll use the query builder to construct a question using Metabase’s Sample Database. Let’s say we want to know how our large orders (that is, orders with a Subtotal greater than $100) are broken out by Product → Category. Figure 1 shows how we’d construct this question in the query builder:

<em>Fig. 1</em>. Asking a question using the query builder.
Fig. 1. Asking a question using the query builder.

Once we visualize our question, let’s add another filter so we’re only viewing full-price orders (orders where there was no discount applied). Figure 2 shows what our query builder looks like just before adding that second filter:

<em>Fig. 2</em>. Adding a second filter while visualizing our data in the query builder.
Fig. 2. Adding a second filter while visualizing our data in the query builder.

Key article

Related terms

Further reading