Semantic view editor¶
The Semantic View Editor allows you to fine-tune your semantic view or build one from scratch. You can use this interface to edit views created by the Autopilot or to upload and edit existing YAML specifications.
Accessing the editor¶
You can access the editor using either a catalog or Cortex Analyst.
To access the editor through a catalog, use the following steps:
Sign in to Snowsight.
Select catalog.
Select your database and schema.
Select Semantic views, and select your view.
Select the Semantic information tab.
Use the following steps to access the editor through Cortex Analyst:
Sign in to Snowsight.
In the navigation menu, select AI & ML » Cortex Analyst.
Select the Semantic views tab.
Open your view.
Editing metadata¶
After you’ve accessed the editor, you can edit the metadata for the semantic view.
To edit the name or description:
Select Edit next to the semantic view name.
Update the Name or Description fields.
Select Save.
Tip
Include detailed descriptions of what kind of analysis this view is useful for.
Managing logical tables¶
A logical table is a view over a physical database table.
To add a table:
Select + Logical Table.
Select the physical table or view.
Select Next.
Select the columns to include.
Select Generate logical table.
To edit a table:
Select Edit (or More options » Edit Logical Table) next to the table name.
Modify the Name, Description, Synonyms, or Primary Key fields.
Select Save.
Tip
Use the Generate fields button to automatically fill in descriptions or synonyms using AI.
Managing content (facts, dimensions, metrics)¶
To add an item:
Select + next to Facts, Dimensions, or Metrics.
Enter the details:
Name
Expression
Data Type
Select Add.
To edit or remove an item:
Select an existing item to edit it, or select More options to remove it.
Content types:
Dimensions: Categorical data, such as Product Region.
Facts: Quantitative data, such as Net Revenue.
Metrics: Aggregations, such as SUM(revenue).
Note
Derived Metrics (combining other metrics) and Private access modifiers are specific features supported in semantic views.
Managing relationships¶
Relationships define how tables join.
To add a relationship:
Select + next to Relationships.
Enter a Name for the relationship.
Select the Left Table and Right Table.
Specify the Join Columns for each table.
(Optional) Specify a join type if needed for legacy compatibility.
Select Add.
The relationship appears in the Relationships list and enables joins between the specified tables.
Note
You typically don’t need to specify the join type for a semantic view. Cortex Analyst determines this at query time, though you can specify it if necessary for legacy YAMLs.
Advanced features¶
To improve the accuracy of Cortex Analyst, you can add the following as context:
Verified queries¶
Verified queries teach the model how to answer complex questions.
Select + next to Verified Queries.
Enter a natural language Question.
Enter the corresponding SQL Query.
Select Add.
The verified query is saved and will be used to guide Cortex Analyst when answering similar questions.
Synonyms¶
Synonyms help users find data using alternative terminology, such as “Client” for “Customer”.
Navigate to the table or column you want to add synonyms for.
Select Edit.
In the Synonyms field, enter alternative terms separated by commas.
Select Save.
Custom instructions¶
Custom instructions provide specific business rules to guide query generation.
Select the Custom Instructions section.
Enter specific business rules, such as “Always filter by active users unless specified otherwise”.
Select Save.
The custom instructions will be applied when Cortex Analyst generates queries using this semantic view.
Uploading a YAML file¶
If you have an existing Semantic Model YAML:
In the navigation menu, select AI & ML » Cortex Analyst.
Select Create new » Upload YAML file.
Select your file.
Select Convert and save to create a native Semantic View from it.