Skip to main content

Snowflake Semantic Views

Introduction​

If a Snowflake semantic view already holds governed dimensions and measures, you can sync it into Holistics to build dashboards, implement embeds, and enable users to self-serve, without maintaining a duplicated definition.

Snowflake semantic view synced into a Holistics model

How it works​

At a high level, a Snowflake semantic view syncs into Holistics as a Table Model.

Snowflake semantic view sync
  • Snowflake semantic view — Dimensions, facts, and metrics already governed in Snowflake
  • Holistics
  • Model — Dimensions, facts, metrics, and descriptions detected and synced automatically
  • Dataset — Add the synced model to a dataset to use it in reports
  • Dashboards
  • [HTML node]
  • semantic-view → model
  • model → dataset (add to)
  • dataset → dashboards (build)
  • This is the semantic view you define in Snowflake. This example uses an analytics.public.orders source table with order_id, order_date, and order_value columns. Each order's value is its amount before discounts:

    CREATE SEMANTIC VIEW analytics.public.orders_semantic_view
    TABLES (orders AS analytics.public.orders PRIMARY KEY (order_id))
    FACTS (orders.order_value AS order_value)
    DIMENSIONS (
    orders.order_month AS DATE_TRUNC('MONTH', order_date)
    COMMENT = 'First day of the order month'
    )
    METRICS (
    orders.total_revenue AS SUM(orders.order_value)
    COMMENT = 'Gross revenue before discounts'
    );
  • In Holistics, add a Table Model with that Snowflake semantic view. Once synced, Holistics automatically detects and syncs its dimensions, facts, metrics, and descriptions. This is the resulting Holistics model:

    orders_semantic_view.model.aml
    Model orders_semantic_view {
    type: 'table'
    data_source_name: 'snowflake'
    table_name: '"ANALYTICS"."PUBLIC"."ORDERS_SEMANTIC_VIEW"'

    dimension order_value { // fact: stays a dimension, never aggregated
    label: 'Order Value'
    type: 'number'
    definition: @sql {{ #SOURCE.order_value }};;
    }

    dimension order_month {
    label: 'Order Month'
    type: 'datetime'
    description: 'First day of the order month'
    definition: @sql {{ #SOURCE.order_month }};;
    }

    measure total_revenue {
    label: 'Total Revenue'
    type: 'number'
    description: 'Gross revenue before discounts'
    definition: @sql AGG({{ #SOURCE.total_revenue }});;
    }
    }

    Here's what each part of the semantic view mapped to in the generated model:

    In the semantic viewIn the Holistics model
    DIMENSIONSdimension
    FACTSdimension (plain number field, not aggregated)
    METRICSmeasure, wrapped in AGG(), aggregated by Snowflake
    COMMENTfield description
  • Then, you can add it to a dataset to build internal dashboards or embedded analytics.

  • If the semantic view's structure changes in Snowflake (a field added, renamed, etc.), in Holistics, use Refresh Model to update latest changes.

Capabilities​

CapabilitySupportDetails
Syncing
Sync
(Snowflake → Holistics)
✅Detected dimensions, facts, metrics, and descriptions automatically the first time the semantic view is added as a Table Model.
Re-sync (Snowflake → Holistics)⚠️
Manual
• If the semantic view's structure changes in Snowflake (a field added, renamed, etc.), in Holistics, use Refresh Model to update latest changes.
• Auto re-sync is not supported.
Write back (Holistics → Snowflake)❌Changes made to the synced model's definition (fields, labels, etc.) in Holistics can't be pushed back to update the semantic view in Snowflake.
Reporting
Build dashboard✅Use dimensions & measures from synced model to build visualizations.
Use window measures⚠️ Workaround• Context: a Snowflake window metric (such as a running total) needs the date it's ordered by in the query, as is. Holistics normally wraps date fields when grouping (timezone, month, and so on), so Snowflake stops the query with a "Required dimensions ... must also be requested" error.
• Fix: duplicate the date field into a new dimension, set its type to text so Holistics doesn't wrap it, and use this new field on the report instead of the original.
Modeling
Build derived metrics✅Build new metrics from the synced model's dimensions and measures, such as ratios and percent-of-total.
Period-over-period⚠️ Workaround• Context: the default calculation needs a join, which Snowflake blocks.
• Fix: toggle "Show comparison period outside base range" in the comparison builder to work around it.
• Trade-off: one extra row appears at the end with a comparison value but no actual value.
Relationship in dataset❌Snowflake rejects any join that touches a semantic view, so a synced model can't be linked to other models in a Holistics dataset.
Synonyms❌Snowflake semantic views can define alternate names (synonyms) for a field. Holistics doesn't support this.

Open Markdown
Let us know what you think about this document :)