Skip to main content

Create a Semantic Model

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe a semantic model.
  • Describe the types of semantic models.
  • Create a semantic model.

Explore Semantic Models

Before you learn how to build a semantic model, you should first understand what semantic models are and how they’re structured. Semantic models are first-class Salesforce metadata, integrated throughout Data Cloud to power analytical and data-driven experiences. The semantic model is composed of a grouping of semantic definitions tailored for a specific analytical use case. Semantic models consist of one or more data objects.

For example, the definition of the revenue measure is made of a set of data objects, relationships, and a formula that defines how it’s calculated. There are a few ways to create semantic models, including from scratch, extending an existing model and more.

If you’re using Tableau Next to create semantic models, see Salesforce Help: Add Semantic Models.

Create Your Semantic Model

To better understand how Tableau Semantics can help you with your business, let’s follow along with Daniel Exposito, a data steward at Main Stage Analytics, as he creates a semantic model. Daniel is interested in understanding his sales and service data. He wants to answer business questions such as ‘how many escalated cases occurred this past quarter’, or ‘what was the refund rate last year compared to this year’. Let’s see how Daniel can use Tableau Semantics to build, author, and govern a semantic model based on ‌sales and service data. This model can then be consumed by business analysts and users later on.

Before he begins, Daniel checks the available data objects in Data Cloud to make sure he has all the required data for creating the semantic model.

From Data Cloud, he selects the Data Model tab.

Data Model screen showing all the data models that exist.Here he can see he has the data model objects (DMOs) that he needs for his semantic model: accounts, sales, product, category, case, and case representative data objects. For more information about data model objects, see Salesforce Help: Data Model Objects (DMOs).

After verifying that he has all the information he needs, he’s ready to create his semantic model. Here’s how he does it.

  1. In Data Cloud, select the Semantic Layer tab.
  2. Click New Model.
    Semantic Layer dialog with new model highlighted.
  1. Select the method you want to use to create the semantic model. Daniel is going to create his model from scratch, so he selects Start with a New Model.
    New Semantic Model dialog with Start with New Model highlighted.
  2. Click Next.
  3. Select the data objects you want to use in your semantic model. You can select data model objects (DMOs), data lake objects (DLOs), and calculated insights (CIs). In this case, select Account, Sales, Product, Product Category, Case, and Case Representative.
    Select Data Objects for Semantic Model dialog.
  4. Click Next.
  5. In the New Semantic Model dialog, enter these details:
    • Enter a unique name for the semantic model.
    • Define the API name of the semantic model. The API name can’t be edited after the model is created.
    • Enter an optional description.
      New Semantic Model dialog
  6. Click Next and then click Create.

The Semantic Model Builder appears and you can see the selected data objects in the middle of the Semantic Model Builder Canvas:Semantic Model Builder with Data Objects and canvas highlighted.

Now that Daniel has set up his semantic model, he can build it by defining relationships between the data objects.

Add Relationships Between Your Data Objects

Relationships are flexible connections between different tables based on common fields. Use the Semantic Layer to establish relationships between your data objects to enrich your data model without the need to define the join type. Think of a relationship as a contract between two tables. When you’re building a visualization with fields from these tables, the Semantic Layer brings in data from these tables using that contract to build a query with the appropriate joins.

Note

We recommend using relationships as your first approach to combining your data because it makes data preparation and analysis easier and more intuitive.

By default, any relationships that were mapped between DMOs in Data Cloud are automatically transferred into the model. Any existing relationships that can create circular relationships (relationships that reference the same object multiple times) are automatically removed. If no relationships were inherited, you can create your own.

There are two ways to create relationships. You can create them manually, or you can use Semantics AI and let Einstein show you suggestions based on your data objects and have them drafted for you.

Note

Semantic Authoring is a pilot/beta service. Any use of Beta Services is subject to the Beta Services terms at https://www.salesforce.com/company/legal/agreements/ or a written Unified Pilot Agreement if executed by the Customer, and any applicable terms in the Product Term Directory.

Manually

To create a relationship manually, he can just click the plus sign next to a data object. And then select the object he wants to connect and the field that connects the two objects. Semantic Model Builder with data object selected and Add Relationship dialog display.

Semantics AI

Daniel decides to use Semantics AI to help create the relationship between Account and Case Data objects. Here’s how he does it.

Note

To use Sematics AI, you must first enable Einstein Generative AI in Data Cloud. For more information, see Salesforce Help: Set Up Einstein Generative AI.


You must turn on Semantics AI in the Feature Manager. For more information, see Salesforce Help: Enable Data Cloud Features.

Note

Semantic Authoring is a pilot/beta service. Any use of Beta Services is subject to the Beta Services terms at https://www.salesforce.com/company/legal/agreements/ or a written Unified Pilot Agreement if executed by the Customer, and any applicable terms in the Product Term Directory.

  1. In the Semantic Model Builder, click Show Suggestions.
    Semantic Model Builder with Suggested Relationships highlighted.
    Here you can see that Einstein found a relationship between Account and Case using the Account ID.
    Recommended relationship with Review highlighted.
  2. You want to make sure this is what you’re looking for, so click Review.
  3. If you need additional fields, click the plus icon and add more fields to the criteria. In this case, you don’t need any more fields, so click Apply.
    Recommended relationships dialog with suggested highlights.
  4. The Semantic Model Builder shows a straight black line, indicating that the relationship is configured correctly.
    Semantic Model Builder with defined relationships in the canvas.

In this unit, you learned about the different ways to create semantic models, how to create a semantic model from scratch, and how to add relationships between your data model objects. Head over to the next unit to see how to create a logical view when you have multiple tables and need one single view of your data.

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback