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

Custom expression

What is a custom expression?

A custom expression in Metabase is a formula that uses functions and mathematical operators to allow for more complicated questions, similar to a formula in spreadsheet software. You can include custom expressions in questions asked via Metabase’s query builder.

Custom expressions give those GUI questions more power and flexibility, without requiring you to write a full SQL query. You can write custom expressions to create custom columns, or to create more advanced filters and aggregations.

Example custom expression in Metabase

The example below shows the creation of a custom column that categorizes Orders according to their Subtotal using the case function.

<em>Fig. 1</em>. Writing a custom expression in the notebook editor.
Fig. 1. Writing a custom expression in the notebook editor.

Figure 2 shows the resulting table, with our new custom column on the right:

<em>Fig. 2</em>. The resulting <strong>Order size</strong> column created using a custom expression.
Fig. 2. The resulting Order size column created using a custom expression.

Related terms

Further reading