LDM Series

Logical Data Model - Objects of the Logical Data Model

  • 19 October 2020
  • 0 replies
  • 442 views

Userlevel 1

Objects of the Logical Data Model

We are continuing in our series of articles about Logical Data Model in GoodData, this time we will describe what objects you can find in the model.

If you have not done it yet, you should also read the previous article in this series: Logical Data Model - Introduction where we have explained what Logical Data Model is and why it is important to understand it.

 

Logical Data Model consists of a handful kinds of objects:

 

Dataset

Dataset is an object in a Logical Data Model. It is a collection of related facts, attributes and references. You can imagine a dataset as a table. (It can physically consist of multiple tables, but on a logical layer, a table is still a very good approximation). Datasets hold the data loaded into them.

In the tool for creating Logical Data Models in GoodData, a dataset is displayed as a box. For example, here is a dataset “Product”:

fbjyqiJS2bUOnJ0YQJ07gcNcHrF8HpoXDupymfQBOjr5eUFtIrvWJoqEuwZt3OgHLxMR5SdYhOqqxZYZREHS24cHeuTz_Yt726IWUcc_ej2CeY1eFEpEjZ33DC4hNs97nLu5DYU

 

Attribute

If you think of a dataset as a table, think of an attribute as a column - more precisely, a column with a string value in it. It typically has some text value in it and gives context to the facts. Attribute values are used for slicing and filtering

Attributes are displayed as lines with the  “ABC” icon (or sometimes “key” icon) within datasets. “Product Type” is an attribute of the dataset “Product”. 

F8EW0xisMUP10R1eLmj5eW9hTd0zea60myD-tIGczXiHM6ZF05xrQl748ASXVdxziIykJy0rATcjmlLBAehYXFoAcJcq5ASFO7a9_b2NPQXOXmAL6P_zdYZ4F4pxebQBIERBXVs

 

Under a single attribute, there can be one or more variants or as they are called in GoodData “labels.” For example, in the case of the “Customer” attribute, there can be “Customer Name“ (the actual human readable name) but also Customer ID (numerical ID used for references) and even “Customer GPS,” which contains the coordinates of that customer to display it on a map. These alternate “labels,” while still representing a single attribute, function as separate columns during the data load. They are not visible in the standard model view, but they can be displayed in the “view details” dialogue for each dataset. 

 

Fact

If you think of a dataset as a table, think of a fact as a column - more precisely, a column with a numerical value in it. They are measurements, amounts, sizes etc. Facts are used in Metrics - typically, facts are aggregated. Facts within one dataset should ideally all have the same granularity which is defined by the primary key of that dataset.

Facts are displayed as lines with the “123” icon within the datasets.

OCAR93CjmCdQI_Q2g7-Tcu59QRqmKEsuE4W6jYx6i9PKrSaAGh4xqWLjgJpISPIqVmHq5e4YoEGfKcAhfNSTQ4dowprq0JFlSw1MqYrvscm9ndYKF_pwsobNJRH9hEVH_xNRHTU

 

Reference

A reference is a way in which datasets can be joined together. End users building the Insights do not need to write explicit database joins like in SQL - all the joins are pre-defined within the Logical Data Model in advance. In GoodData you can only join datasets based on a single-column key.

 

References are represented as arrows between the datasets. A one-way arrow represents a  one-to-many relationship (note that in GoodData the arrow goes from the Primary Key to the Foreign Key - the opposite of some other tools). Two-way arrows represent a many-to-many relationship.

In our sample model, there are several references. For example, the one between “Order” and “Customer” datasets. The arrow goes from Customer to Order, which means that each order needs to have exactly one customer. You can also see that there is a Customer key in the Order dataset under the line, which means that a foreign key is referencing the Customer attribute.

 

Note that the arrows in the diagram point between datasets generally, and they do not necessarily point to a specific attribute or foreign key—though it may appear that way.

69w8OYb93ePYIojsvoDp3sxBzKnCn2fFzzJhTjjDYFUqbEoa6HNhls06Zjb-88uDEh8ieiJcg9rsuQOF-bhvG6QKjJurfER0-bcouMsCbiwi0E2LFbghItMbCr86DeknU_9cH5g

The reference between “Product” and “Product Tag” is an example of a many-to-many reference where each product can have multiple tags, and each tag can be assigned to multiple products.

 

 i2kfgC4bQSqXQsBCK73hcxvcNtZRVKEaLhdcYnBoGy3zhDTL0ZQmZlwL9rU-e95kNudbv9OdPP9E2idynB41Zi681_93Rrn5MLFcAlvdTRgVlp7JWjwR6UYUshJhMRgRYShDYSk

 

Date Dimension

Dates have a special role in GoodData and are represented by Date Dimensions. You connect a Date Dimension to your dataset by a reference (like you would connect any other dataset). 

 which are referenced from datasets. Each date dimension contains a standard calendar ranging between 1900 to 2050 and can be loaded with customized content (i.e. fiscal calendar) if needed. Note that the built-in date dimension in GoodData does not contain the time portion in it.

Sales Date and Shipment Date are examples of date dimensions.

ExchpPdDBh_lYDJH95at_sIIiUdiODHVPeA2LI2pnUqJ4bplWRegH-dDejHQPHW_4DBMvP3Jb2hA-0HiC7kzoW-qrzZncHInEvMHTDV0_YBrABaJLs5NZ9--xUjvgJebz3CrEz0

 

 

Next article in this series is:  Logical Data Model - Basic Rules of Data Modelling

Let us know how you like this series and feel free to post questions if something is not clear to you. For more information and practice about data modelling, please also attend our free courses at GoodData university


0 replies

Be the first to reply!

Reply