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
| Command | What it does |
|---|---|
kater filter list | Every filter and plain condition, in one shape. |
kater filter add | Add a filter, as the + does. |
kater filter change | Write another condition under the same name. |
kater filter set | Change the cog’s settings, or the name. |
kater filter split | Make one filter of each condition of an AND. |
kater filter name | Make a plain condition a filter. |
kater filter move | Move a query’s filter to its workspace. |
kater filter remove | Remove 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
# Go to the ad_reporting workspace in your local copy of Kater contentcd connections/snowflake_prod_connection/workspaces/ad_reporting# List every filter of the query, and each plain conditionkater filter list paid_media_spend_trend# Show the SQL that a new filter on platform writes, and write nothingkater filter add paid_media_spend_trend platform --is-one-of Google Meta# Add the filterkater filter add paid_media_spend_trend platform --is-one-of Google Meta --write# Hold the date filter to the last 6 complete monthskater 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 itkater filter move paid_media_spend_trend is_within_last__union__date_day --write