Skip to main content
On this page

Kater CLI Build an analysis query

kater query card

Turns a saved query into an Explore card.

The card takes the query’s chart to another workspace over the same shared model. It holds the query’s fields, with each filter the chart applies written in as a condition. It saves nothing.

Examples

Terminal window
# Turn the spend_by_platform query into a card, with the request in card.json
kater query card --request-file card.json
# Turn the paid_media_spend_trend query into a card for the last 6 complete months
echo '{"namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}, "document": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting/query_contracts/paid_media_spend_trend.sql"}, "inputs": {"parameters": {"is_within_last__union__date_day": 6}, "filters": ["is_within_last__union__date_day"]}}' | kater query card --request-file -

Arguments

ArgumentDescription
<path>Optional. In place of --request-file: the workspace, the query file or the chart file the request names.

Options

OptionDescription
--request-file <file>The JSON request. - reads it from standard input. See The request.

It also takes the global options --json, --kater-root, --scope and --help.

The request

card.json
{"namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}, "document": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting/query_contracts/spend_by_platform.sql"}}
KeyWhat it holds
namespaceThe query’s workspace, by its path from the content root.
documentThe query’s file, as {"path": ...} from the content root.
inputsWhat the chart runs with: parameters gives the parameter values, and filters lists the filters to turn on. Without it, the query’s own filters keep their defaults, and no workspace filter is carried.
titleThe card’s title. Without it, the query’s label.
kindThe chart’s type, which the card keeps where its fields fill it. Without it, Kater charts the card as its fields suit best.
leaveFields that the other workspace’s filters hold rows by. A condition on one of them stays behind, because the chart follows that workspace’s filter.

What it answers

card is the Explore card. Add it to another workspace with kater explore card add. carried names, by label, the workspace filters that the card holds as its own conditions.

Kater refuses a query whose workspace adds fields or joins of its own to the shared model. To open a query in the Sandbox with its workspace, use kater query sandbox.

See also