Create a Logical Data Model Manually

Once you have generated the physical data model (PDM) either using the API or in the LDM Modeler, create the logical data model (LDM) manually in the LDM Modeler.

To create the LDM manually, do the following:

  1. Create datasets.
  2. Map the LDM to the PDM.
  3. Set the primary key in datasets.
  4. Create relationships between the datasets.
  5. Add Date datasets.
  6. Publish the LDM.

Create Datasets

Steps:

  1. Open your workspace.

  2. Click the Data tab.

    The LDM Modeler opens in view mode.

  3. Click Edit.

    The LDM Modeler is switched to edit mode. You can see the registered data sources in the left panel.

  4. To add a dataset, drag Empty dataset from the left panel and drop it in the blank canvas area.

  5. Select the newly added dataset, click More… -> View details.

  6. Add fields (facts, attributes, and attribute labels) to the dataset.

  7. Create as many datasets as you need.

Here is the example of a manually created dataset named Order lines:

New dataset

Map the LDM to the PDM

Mapping your LDM to the PDM allows you to use the data from your database when you create insights.

Steps:

  1. Click Scan next to the data source that represents your database.

    The scan dialog opens.

  2. De-select the Generate datasets checkbox to prevent automatic generation of datasets.

    Scan only mapping

  3. Click Scan.

    The scanning process starts. It scans the physical tables/views in your database so that you can then map the LDM components to the tables/views and columns in your database through the PDM (that is, map the datasets to the tables/views and map the attributes/facts/references to the table/view columns).

    When the scanning completes, you see a confirmation message.

  4. Set up mapping for all the datasets in your LDM.

    1. Select a dataset, click More… -> View details.

    2. Click the Data mapping tab.

    3. Map the dataset to a particular table in your database.

      Select a table

    4. Map each field in the dataset to a specific column in this table.

      Map columns

    5. Click Save changes.

    6. Repeat Steps 1-5 for every dataset.

Set the Primary Key in Datasets

Set the primary key (grain) for each dataset in your LDM.

Steps:

  1. Select a dataset, and click More… -> Set primary key.

  2. Select the attribute that should become the primary key, and click Set key.

    Set primary key

    The dialog closes, and the primary key is set.

  3. Repeat Steps 1-2 for every dataset in your LDM.

Create Relationships between the Datasets

A relationship between two datasets allows you to use information from one dataset to slice the data in the other dataset. Creating relationships allows you to discover new analytical scenarios when creating insights.

Creating a relationship requires a primary key in one of those datasets.

Steps:

  1. Locate the datasets that you want to create a relationship between.

    References - second table

  2. Select the dataset from which you want to start a relationship. Click the blue dot on the right border of the dataset and drag the arrow that appears to connect it to the other dataset.

    The relationship is created.

    In the following image, the Customers dataset is connected to the Order lines dataset.

    References - reference

    Notice that the Order lines dataset has been extended by the Customer id foreign key.

  3. Select the dataset where the foreign key was added to, click More… -> View details, then click the Data mapping tab.

  4. Locate the newly added foreign key, and map it to a column in the table that is mapped to the dataset (the foreign key column).

    References - reference mapping

  5. Repeat Steps 1-4 for all the datasets in your LDM that you want to connect.

Add Date Datasets

A Date dataset is a dataset that represents DATE / TIMESTAMP columns in your database. The Date dataset helps you manage time-based data and enables aggregation at the day, week, month, quarter, and year level.

Steps:

  1. Drag Date from the left panel and drop it in the blank canvas area.

    New date

  2. Create a relationship between the new Date dataset and a dataset that contains a date/timestamp column.

    In the following image, the dataset with a date/timestamp column is the Order lines dataset.

    Date reference

    Notice that the Order lines dataset has been extended by the Date foreign key.

  3. Select the dataset where the foreign key was added to, click More… -> View details, then click the Data mapping tab.

  4. Locate the newly added Date foreign key, and map it to a column in the table that is mapped to the dataset (the foreign key column).

    Date reference mapping

  5. (Optional) Configure the Date dataset.

    1. Select the dataset, and click Details.

      Date details

    2. In the configuration dialog, configure the dataset as needed:

      Date details dialog

      • Add a description to the dataset.

      • Configure how the name of the included date/time granularity levels will be displayed.

        The Title pattern field defines the general format for the titles of all included granularity levels. Use the %titleBase and %granularityTitle placeholders to define the order in which the value from the Title base field and the default granularity title will be used in the title. If Title base is not specified, the default name of the Date dataset (Date) will be used (for example, Date - Year, Date - Hour, and so on).

      • Select the date/time granularity levels that you want to include in the Date dataset.

        Some date granularity levels are selected by default and cannot be excluded from the Date dataset.

  6. Create as many Date datasets as you need.

Publish the LDM

To publish the LDM, follow the instructions from this article.

Once you have the LDM published, you can start building insights and dashboards.