Skip to main content
On this page

Kater SQL Functions Filters

REQUIRED_FILTER

Declares a filter that always applies.

Family: Filters

A reader cannot switch it off.

Syntax

WHERE
REQUIRED_FILTER('name', condition, label='Label')

Arguments

ArgumentDescription
nameThe filter’s name, in quotes.
conditionThe condition the filter applies, such as KATER__IS_NOT_NULL(orders.region). It reads no parameters.
labelThe name a reader sees, such as 'Region is set'.

Returns

Nothing of its own. The query keeps only the rows where the condition is TRUE.

Usage notes

  • Write it as a direct AND condition of WHERE.
  • A measure’s required filters stay in force under every EVAL modifier, CLEAR() included.

Example

This Sandbox query reads the sample shop’s orders. The table shows the rows that Kater gave.

SELECT
orders.region AS "Region",
EVAL(orders.count_distinct__order_id) AS "Orders"
FROM kater_dataset.orders AS orders
WHERE
REQUIRED_FILTER('is_not_null__region', KATER__IS_NOT_NULL(orders.region), label='Region is set')
GROUP BY
orders.region
ORDER BY
1
RegionOrders
AMER728
APAC671
EMEA777
LATAM760

See also