Skip to content

Views

A view is a YAML file that packages one or more cubes into a single, curated dataset. Views are what end users — and the Streya agent — query; cubes stay behind the scenes.

# view name: "sales_analytics"
title: Sales Analytics
description: >
One row per (month × customer × product), 5 years of history.
Use for: revenue trends, customer-mix shifts, product-level pricing analysis.
Numbers reconcile to ERP at the monthly grain only.
public: true # views default to public
cubes:
- join_path: orders
includes: "*"
excludes:
- internal_id
prefix: true
- join_path: orders.customers
includes:
- name
- segment
- lifetime_value
prefix: true
# Optional
extends: base_view_name
meta: {}
PropertyTypeDescription
titlestringHuman-readable display name.
descriptionstringThe agent’s primary entry point to this dataset — what it is, its grain, and when to use it. See writing good descriptions.
publicbooleanWhether end users see the view. Defaults to true. Set false for internal or in-development views.
metaobjectFree-form metadata.
extendsstringInherit from another view and override selectively.
access_policyobjectColumn- and row-level access rules. See access policies.

Each entry pulls fields from a cube into the view.

Which cube to include, optionally traversing joins with dot notation. Each segment must match a join defined in the cube schema.

cubes:
- join_path: orders # the orders cube itself
- join_path: orders.customers # customers, joined through orders
- join_path: orders.order_items.products # two hops

Control which dimensions and measures are exposed.

# Explicit allowlist — when only a subset is relevant
- join_path: orders
includes:
- status
- created_at
- total_revenue
# Everything except — when most fields are relevant
- join_path: orders
includes: "*"
excludes:
- internal_id
- debug_timestamp

excludes takes precedence over includes.

Whether field names are prefixed with the cube name (orders.status vs status).

- join_path: orders
prefix: true # fields appear as orders_status, orders_count, …

Guideline: prefix: true for multi-cube views (avoids name collisions and shows provenance); prefix: false for single-cube views (cleaner names).

customer_list.yml
title: Customer List
description: All customers with their profile fields. Use for lookups and segmentation counts.
cubes:
- join_path: customers
includes: "*"
prefix: false
sales_analytics.yml
title: Sales Analytics
description: >
Order lines enriched with customer and product attributes.
Use for revenue analysis by customer segment, category, or brand.
cubes:
- join_path: orders
includes: "*"
prefix: true
- join_path: orders.customers
includes: [name, segment, lifetime_value]
prefix: true
- join_path: orders.order_items.products
includes: [name, category, brand]
prefix: true