Skip to main content
On this page

Kater CLI Build an analysis filter

kater filter

Lists, adds and changes the filters of a query or a workspace, as the filter pill in Kater does.

Each command sends the operation that the pill sends, so the operation writes each filter’s call and checks each value against the data. Do not write OPTIONAL_FILTER, REQUIRED_FILTER or a KATER__ condition by hand.

Commands

CommandWhat it does
kater filter listEvery filter and plain condition, in one shape.
kater filter addAdd a filter, as the + does.
kater filter changeWrite another condition under the same name.
kater filter setChange the cog’s settings, or the name.
kater filter splitMake one filter of each condition of an AND.
kater filter nameMake a plain condition a filter.
kater filter moveMove a query’s filter to its workspace.
kater filter removeRemove a filter or a plain condition.

It also takes the global options anywhere on the line, and --help.

Every write shows its change first

Without --write, a command writes nothing. It shows the SQL that it would write, as a diff, the filter’s name and label, and how many queries, charts, dashboards and apps the change reaches. Run the same line with --write to make the change.

A condition is one flag

Each condition has its own flag, such as --is-one-of VALUE..., --is-not-one-of VALUE..., --is-equal-to VALUE, --is-at-least VALUE, --is-between LOW HIGH, --contains TEXT, --is-empty, --is-within-last N UNIT and --is-on-or-after DATE. A flag takes the words after it, up to the next flag. kater filter add --help lists every flag, and kater filter list shows the flags that each filter’s field takes.

A date is a date, such as 2026-01-31, or a relative date, so the filter moves with each day: today, now, '3 months ago', '3 complete months ago', '1 week ahead' or 'start of this month'.

Real values

The command refuses a value that no row holds, and names the values near it, such as “No row has Currency usd. USD is near it.”. Get the values with kater field values first. Add --allow-unseen only for a value that the data will hold later.

A filter written as SQL

No command writes over a filter that its author wrote as SQL. kater filter change refuses it and says what to do: kater filter split for an AND of conditions, or a change in the SQL editor.

Examples

Terminal window
# Go to the ad_reporting workspace in your local copy of Kater content
cd connections/snowflake_prod_connection/workspaces/ad_reporting
# List every filter of the query, and each plain condition
kater filter list paid_media_spend_trend
# Show the SQL that a new filter on platform writes, and write nothing
kater filter add paid_media_spend_trend platform --is-one-of Google Meta
# Add the filter
kater filter add paid_media_spend_trend platform --is-one-of Google Meta --write
# Hold the date filter to the last 6 complete months
kater filter change paid_media_spend_trend is_within_last__union__date_day --is-within-last 6 month --complete --write
# Move the date filter to the workspace, so every query has it
kater filter move paid_media_spend_trend is_within_last__union__date_day --write

See also