These are the docs for the Metabase master branch. Some features documented here may not yet be available in the latest release. Check out the docs for the latest version, Metabase v0.54.

In

in compares values and returns true if value1 equals value2 (OR value3, etc., if specified).

in(value1, value2, ...)

Copy

Copied

value1 is the column or value to check.

value2, ... is the list of columns or values to check.

Metabase will return rows where the value1 equals value2 OR value3, etc. Matches must be exact (e.g., strings are case sensitive).

For example,

in([Category], "Gadget", "Widget")

Copy

Copied

would return rows where [Category] is either Gadget or Widget.

You can choose multiple columns. For example, let’s say you wanted to find records where [Title] or [Category] fields are equal to Gadget. You could write:

in("Gadget", [Title], [Category])

Copy

Copied

in works like SQL’s in function.

So if you have the expression: in[title], "Lightweight Wool Computer", "Aerodynamic Cotton Lamp"), in SQL, it would be:

title IN ('Lightweight Wool Computer', 'Aerodynamic Cotton Lamp')

Copy

Copied

But under the hood, Metabase translates this IN expression to a WHERE clause that uses the OR operator:

WHERE title = 'Lightweight Wool Computer' OR title = 'Aerodynamic Cotton Lamp'

Copy

Copied

Data type Works with in
String
Number
Timestamp
Boolean
JSON

Read docs for other versions of Metabase.