Query and extend Snowflake semantic views in Sigma (Beta)
This documentation describes a public beta feature and is under construction. This page should not be considered part of our published documentation until this notice, and the corresponding Beta flag on the feature in the Sigma service, are removed. As with any beta feature, the feature discussed below is subject to quick, iterative changes. The latest experience in the Sigma service might differ from the contents of this document.Beta features are subject to the Beta features disclaimer.
Snowflake semantic views are a new way to define governed, reusable business logic directly within Snowflake using SQL. Semantic views allow you to model metrics, dimensions, and relationships in a declarative, version-controlled, and queryable format. Rather than living in a third-party tool, this logic can now live directly next to your data in Snowflake. Semantic views are defined using SQL-based metadata definitions, and result in readable views that BI tools and AI agents can query via standard SQL
You can work with the metrics and related columns defined in the semantic view in Snowflake in your Sigma workbooks and data models to do the following:
- Build a table in a data model using the semantic view as a source.
- Add tables, pivot tables, and charts to a workbook that use the semantic view as a source.
- Query the view with custom SQL.
- Browse semantic views in the data catalog.
For more details about Snowflake semantic views, see Overview of semantic views in the Snowflake documentation.
Limitations
The following is not yet supported:
- Performing a join, union, or transpose with a semantic view.
- When using a list values control or a segmented control, you cannot source the values for the control from a semantic view.
- You cannot target a semantic view data source with a control element.
- Semantic view elements on hidden pages in public embeds (page, element, and workbook) will not work.
- No public APIs are compatible with semantic views.
When working with semantic views in Sigma, the following limitations apply:
- Metrics defined in the semantic view are available only to the element directly sourced from the semantic view. Metrics are not available to child elements.
- Relationships defined in the semantic view are available only to the element directly sourced from the semantic view. Related columns are not available to child elements.
Due to other limitations, the following is also not yet supported:
- If your semantic view defines two dimensions with the same name, but from different tables, the semantic view cannot be queried and attempts to query it fail with an error.
Requirements
The role used by the Snowflake connection in Sigma must be granted SELECT privileges on the semantic views that you want to work with in Sigma. For more details, see Granting privileges on semantic views
Browse a Snowflake semantic view in the data catalog
If you have a semantic view defined in the Snowflake account connected to Sigma, you can browse the view, tables, dimensions, metrics, and relationships defined in the view in the data catalog.
For example, given a Snowflake semantic view with a definition that matches the example in the Snowflake documentation, Using SQL commands to create and manage semantic views, with the following characteristics:
- A semantic view called
tpch_rev_analysis
. - Tables in the view called
orders
,lineitem
, andcustomer
. - Dimensions, for example, orders.order_date AS orders.o_orderdate
- Relationships between tables, for example, the
lineitem
table is related to theorders
table. - Metrics on specific tables, for example, the
order_count
,order_average_value
, andaverage_line_item_per_order
metrics on theorders
table.
You can browse the semantic view in Sigma.
-
From Sigma Home, select Connections to open the list of connected data sources.
-
Select the data connection with the data catalog that you want to view.
-
In the left navigation panel, search or browse the data catalog to locate the semantic view that you want to browse.
Select the semantic view name, for example,
TPCH_REV_ANALYSIS
to view access granted to the object. -
In the semantic view, select an individual table to view more details. For example, select the
LINEITEM
table:- On the Overview tab, review the columns and data in the table.
- On the Columns tab, review the column names, data types, formats, and description. You cannot modify the description of a column in a semantic view.
- On the Metrics tab, review the names, formulas, data format, and descriptions of any metrics defined on the table in the semantic view.
- On the Relationships tab, review the target table of the relationship and optionally click the link to open the table in a new tab. The source key and target key for the relationship are also listed.
- On the Lineage tab, review any workbooks or data models that use the table as a source.
-
Click Explore to open the table in an exploration.
Work with a Snowflake semantic view in a data element
You can use a semantic view as a source for a data element:
-
Open a data model or workbook for editing.
-
Add a data element to your document.
-
Browse to and select the semantic view in your Snowflake connection that you want to add.
The semantic view functions like a folder, allowing you to choose one of the related tables in your workbook to use. The relationships in the semantic view are directional, so only dimensions from tables joined via one-to-one or many-to-one relationships are accessible.
For example, to view all dimensions from the
LINEITEM
,ORDERS
, andCUSTOMERS
tables, choose theLINEITEM
table as a data source. -
After you add the semantic view table as a data source, the relevant dimensions are available on the table. The default name for the element matches the semantic view name. For example, after you choose the
LINEITEM
table, theORDERKEY (LINEITEM)
andPARTKEY (LINEITEM)
columns are available: -
If the table is related to other tables in the semantic view, you can view the dimensions from the related tables and add them to your table element in Sigma. To review and add the dimensions from the related tables, open the Source columns for the data source.
For example, the
LINEITEM
table is related to theCUSTOMERS
andORDERS
tables, so you can add the CUSTOMER_ NAME column from theCUSTOMERS
table, or the ORDER_DATE column. -
If the table has any metrics defined from the semantic view, those are also accessible. To work with the metrics, click Metrics and add one or more metrics to the table.
Query a semantic view from Sigma
You can query a semantic view directly using a SQL query with the custom SQL functionality in Sigma. See Write custom SQL.
Updated about 3 hours ago