Skip to main content
Defines a list of sample queries that could be performed on the topic, which is used: You can add a workbook query to this parameter using one of the following methods:
  • From the Model menu: Click Model > Save as sample query to topic in the workbook.
  • From the inspector: Click the near the bottom left corner of the page to open the workbook inspector. Click Copy query and visualization YAML in the inspector header to copy the query and visualization configuration in the sample query format, then paste it into your topic file in the model IDE.

Syntax

sample_queries:
  <query_name>:
    query:
      fields: [ "<field_one>", "<field_two>", ... ]
      base_view: "<base_view_name>"
      calculations:
        <calculation_name>:
          sql: "<sql_expression>"
      limit: <number>
      sorts:
        - field: "<field_name>"
      topic: "<topic_name>"
    description: "<query_description>"
    hidden: true/false
    prompt: "<natural_language_prompt>"
    ai_context: "<ai_context_description>"
    exclude_from_ai_context: true/false

Properties

query_name
object
required
The name of the sample query (e.g., “Summary Stats”). Each query is defined as a key in the sample_queries object.

Examples

sample_queries:
  Summary Stats:
    query:
      fields: [ order_items.sale_price_sum, users.count, calc_1 ]
      base_view: order_items
      calculations:
        calc_1:
          sql: OMNI_FX_SAFE_DIVIDE(${order_items.sale_price_sum}, ${users.count})
      limit: 1000
      sorts:
        - field: order_items.sale_price_sum
      topic: order_items
    description: Total Revenue, Users and Revenue per User
    hidden: false
    prompt: show me total revenue, count of users and revenue per user
    ai_context: uses a calculation to compute avg. revenue per user
    exclude_from_ai_context: false