Skip to main content
On this page

Kater CLI Present and share insight

kater insight run

Runs one insight template over the result of a workspace query, as a dashboard's key takeaways do.

Name the template, and match each of its columns to a column of the query. It writes nothing.

Examples

Terminal window
# Find whether one platform takes most of the spend
kater insight run --request-file largest_platform.json
# Make a request that calls a platform dominant at 40 percent of spend, and send it
jq '.parameters = {"dominance_share": 0.4}' largest_platform.json > largest_platform_40.json
kater insight run --request-file largest_platform_40.json

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 query, the template, and how their columns match, as JSON. Give - to read it from standard input. See The request.

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

The request

FieldWhat it holds
namespaceThe workspace, by its full path.
queryThe query, by its name, such as spend_by_platform.
insightThe template, by its name, such as largest_segment.
columnsEach column of the template, matched to a column of the query.
parametersOptional. Values for the template’s own parameters, such as dominance_share.
inputsOptional. The query’s parameter values and filters.
freshOptional. True runs the query on the warehouse again.

The largest_segment template takes a segment column and a value column. This file matches them to platform and sum__spend:

largest_platform.json
{"namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}, "query": "spend_by_platform", "insight": "largest_segment", "columns": {"segment": "platform", "value": "sum__spend"}}

Templates

Kater’s templates are in the connection’s modeling/.kater/insight_templates/. A template of your own in modeling/kater_objects/custom_insight_templates/ takes the place of Kater’s template with the same name. The query must be in a workspace, and you need permission to run it. The query’s own optional filters are on.

See also