Update a Logical Data Model

For project administrators only

In a typical workflow, you may need to update the logical data model (LDM) in your workspace from time to time using GoodData LDM Modeler. For example, when you add a table to your source data, you have to add a dataset to your LDM to keep the source data and the LDM synchronized. You may need to establish new relationships between datasets or update properties of facts or attributes.

Updating the data model may include the following tasks:

  • Add or delete datasets
  • Add or delete relationships between datasets
  • Add, delete, or move attributes and facts
  • Edit attributes, attribute labels, and facts in a dataset and manage field mapping
  • Set a primary key in a dataset

Every time you update the LDM, you have to publish it to the workspace and then create the updated version of the Output Stage.

Contents:

Open the Logical Data Model in the LDM Modeler

To learn how to access the LDM Modeler, click here.

Update the LDM

Perform one or more updates as you need.

When you are working on your LDM, the changes are automatically saved as a draft as you are making them. The draft is saved under your GoodData user, on the machine and in the browser it was created, and you can continue editing it whenever you are ready. When the LDM Modeler saves your draft, it displays a message and the time the draft was last saved.

The draft is kept until you either publish the changes to the workspace or manually discard the draft (in this case, the last published version of the LDM is loaded in the LDM Modeler).

Add a dataset manually

Steps:

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

     
  2. Name the dataset.

Add a dataset from a CSV file

If you have a CSV file with data, you can use it to create a dataset. For more information, see Create a Logical Data Model from CSV Files.

Add a dataset from your data warehouse

You can use tables and views in your data warehouse (such as Snowflake, Redshift, or BigQuery) to create datasets. For more information, see Create a Logical Data Model from Your Cloud Data Warehouse.

Add a fact to a dataset

For more information about facts, see Facts in Logical Data Models.

Steps:

  1. In the dataset, click the 123 button.

     
  2. Name the fact.

You can also add a fact to a dataset from the dataset details dialog.

Add an attribute to a dataset

For more information about attributes, see Attributes in Logical Data Models.

Steps:

  1. In the dataset, click the ABC button.

     
  2. Name the attribute.

You can also add an attribute to a dataset from the dataset details dialog.

Move a fact or an attribute between datasets

When you move a fact or an attribute from one dataset to another, the identifier of the moved object does not change. This preserves the measures, reports, and dashboards where the moved object is referenced by its identifier.

For example, if you are moving the Department ID attribute from the Payments dataset to the Departments dataset, the initial attribute identifier (attr.payments.departmentid) will remain the same.

You cannot move the attributes that are used in the dataset's primary key.

When an attribute is moved, all its labels are moved together with it, and their identifiers do not change.

Steps:

  1. In the dataset, click the fact or the attribute that you want to move, click the menu button, and click Move.
  2. Select the dataset to move the fact or the attribute to, and click Move.

You can also move a fact or an attribute to another dataset from the dataset details dialog.

Delete a fact or an attribute from a dataset

You cannot delete the attributes that are used in the dataset's primary key.

Steps:

  1. In the dataset, click the fact or the attribute that you want to delete, click the menu button, and click Delete.
  2. Confirm the deletion.

You can also delete a fact or an attribute from the dataset details dialog.

Manage facts, attributes, and attribute labels in a dataset

Select the dataset, click More... -> View details.

The dataset details dialog opens that lists all the dataset facts, attributes, and attribute labels.

This dialog allows you to manage the facts, attributes, and attribute labels in the dataset and to edit their properties.

When you are done with updating, click Save changes.

Add a fact

Click the 123 button, and name the fact.

You can also add a fact from outside of the dataset.

For more information about facts, see Facts in Logical Data Models.

Add an attribute

Click the ABC button, and name the attribute.

When you add an attribute, it is added with a single default label, which has the same name as the attribute itself.

You can also add an attribute from outside of the dataset.

For more information about attributes and labels, see Attributes in Logical Data Models.

Add a label to an attribute

For more information about attributes and labels, see Attributes in Logical Data Models.

Steps:

  1. Hover over the attribute, click Add label.
  2. Select the type of the label. For more information about label types, see Attributes in Logical Data Models.
  3. Name the label.

By default, an attribute label is added with a limit of 128 characters. For hyperlink labels, this may not be enough to store a full URL. Consider expanding this limit by changing the label's datatype.

Rename a fact, an attribute, or a label

Click the name of the fact, the attribute, or the label, and enter a new name.

Move a fact or an attribute to another dataset

For all the details about moving a fact or an attribute, see Move a fact or an attribute between datasets.

Steps:

  1. Hover over the fact or the attribute that you want to move, click the menu button, and click Move.
  2. Select the dataset to move the fact or the attribute to, and click Move.

Change the data type of a fact or an attribute label

Click the current data type and select a different one from the dropdown.

For the data types that can hold a various number of characters (such as text or a decimal), you can change this number by manually editing it in the dropdown:

For more information about the supported data types, see Facts in Logical Data Models and Attributes in Logical Data Models.

Delete a fact, an attribute, or an attribute label

Hover over the fact, the attribute, or the label, click the menu button, and click Delete.

You cannot delete:

You can also delete a fact or an attribute from outside of the dataset.

Manage field mapping in a dataset

Any dataset in your LDM must have each field (a fact or an attribute) unambiguously mapped to a column in a source table (represented by a table in your data warehouse or a CSV file). The dataset itself must be mapped to this source table.

During data load, the data from the columns in the source table will be loaded to the corresponding facts or attributes in the dataset.

Steps:

  1. Select the dataset, click More... -> View details.

    The dataset details dialog opens that lists all the dataset facts, attributes, and attribute labels.
  2. Click the Load configuration tab.
  3. Review the current mapping and update it, if needed. For more information, see Mapping between a Logical Data Model and the Data Source.
  4. When you are done with updating, click Save changes.

Rename a dataset

Double-click the dataset name, and enter a new name.

Set the primary key in a dataset

For more information about primary keys, see Primary and Foreign Keys and Connection Points in Logical Data Models.

Steps:

  1. Select the dataset, click More... -> Set primary key.
  2. Select the attribute that should become the primary key, and click Set key.

For specific use cases, you can set grain instead of the primary key. Grain is a compound primary key that contains more than one attribute. For more information, see Set the Grain of a Fact Table to Avoid Duplicate Records.

Add a Date dataset

For more information about dates, see Dates in Logical Data Models.

Steps:

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

     
  2. Name the dataset.

Delete a dataset

Select the dataset, click More... -> Delete, and confirm the deletion.

Add a relationship between datasets

Creating a relationship requires a primary key in the dataset with the data that you want to use to help analyze the other data. For more information about the primary key, see Connection Points in Logical Data Models.

Steps:

  1. Select the dataset.
  2. Click the blue dot on the right border of the dataset and drag the arrow that appears to connect the dataset to the other dataset.

     
    The relationship is created.

Delete a relationship

Select the relationship and click the bin icon that appears.

Publish the LDM

When you are done with updating the LDM, publish it to the workspace. To publish the LDM, follow the instructions from Publish a Logical Data Model.

When asked to choose the mode of publishing:

  • Use Preserve data when your edits do not include deletion of any current data from the LDM. If you deleted anything by mistake, the publishing process fails, and no changes will be made to your current LDM. This helps prevent unintentional deletion of objects or relationships from the LDM and potential data loss.
  • Use Overwrite when you need to delete some objects or relationships from the LDM.

    Use the Overwrite mode carefully.

    If the LDM update includes the deletion of facts or attributes that are currently used in any measure, report, or dashboard in your workspace, those measures, reports or dashboards will stop working and may cause data inconsistency or loss. The publishing cannot be undone.

If you are using the Output Stage, update it to synchronize it with the updated LDM after the LDM has been published (see Create the Output Stage based on Your Logical Data Model).


Powered by Atlassian Confluence and Scroll Viewport.