Skip to main content
On this page

Kater CLI Explore and try ideas explore card

kater explore card create

Makes a new card from fields you select on a shared model, and gives its query and chart.

Use it when no card of the tour shows what you need. Nothing is saved, and nothing runs on the warehouse.

Examples

Terminal window
# Make a card of spend by platform on the ad_reporting model
kater explore card create --request-file new-card.json
# Make the card and keep the answer as JSON, to use its card in later requests
kater explore card create --request-file new-card.json --json > created.json

Options

OptionDescription
--request-file <file>Required. The new card’s request as JSON, from a file. - reads stdin. It names the model and the fields to show. See What the request holds.

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

What the request holds

  • namespace and source. The shared model, as The request file shows.
  • fields. The fields to show, from 1 to 24. Each names a field of the model in field, as a query writes it, such as sum__spend. It can also give one operation from the field’s menu, with its parameters.
  • conditions. The conditions the rows must meet. Each gives a field, an operation such as is_one_of, and its parameters.
  • order. How to sort the rows. Each gives a field the card shows, and descending to sort from largest.
  • limit. The most rows, from 1 to 10,000.
  • kind. The chart kind, such as bar or line, when the fields can fill it. Left out, Kater selects the chart that suits the fields best.
  • include_fields. Set it to true to also list the model’s fields that the card can add, each with its menu.

This file makes a card of spend by platform, largest first:

new-card.json
{"namespace": {"kind": "shared", "connection": "snowflake_prod_connection"}, "source": {"path": "connections/snowflake_prod_connection/modeling/kater_objects/semantic_models/marts/AD_REPORTING.sql", "identity": {"name": "AD_REPORTING", "model_type": "semantic", "namespace": {"kind": "shared", "connection": "snowflake_prod_connection"}}}, "fields": [{"field": "platform"}, {"field": "sum__spend"}], "order": [{"field": "sum__spend", "descending": true}]}

The answer gives the card as card, its SQL as query_sql, its chart as definition, and its fields and conditions. Put its card in the requests of the other card commands.

See also