Setting up data models
Last updated
Last updated
This is the last step before data cards can be created and is the one that brings most value to data analysis. Any data card needs a data model in order to run queries.
You must create a data model by clicking the "Add" button in the list of Data Models in the Data Center.
In this case, our data is stored in a PostgreSQL database, so the data is not managed by Biuwer but by our organization. For this reason, we have to create a "Not Managed" model, as Biuwer does not manage this data. For this example we have called "Rental Basic", using the "Film rental DB" connection as the data source.
We must then add datasets and relationships between them. For this, it is necessary to know how the data are stored and how they relate to each other. You can use the record viewer of datasets to see a preview of the data and in case you need to relate the data, know by which fields this association should be made.
We need the following datasets for the example we are looking at:
rental: this is the so-called fact table, in theoretical Business Intelligence terminology, in which rentals are stored, with their dates (rental_date), customer codes (customer_id) and inventory code (inventory_id).
customer_list: is a table that acts as a dimension, in theoretical Business Intelligence terminology, in which customers are stored with a unique identifier (id) and among other information, the customer's name, country and city.
film_list: this is also a dimension table, in which films are stored with a unique identifier (fid), and among others, a title and its price.
category: this is also a dimension table, in which categories of films are stored with a unique identifier (category_id) and their name.
inventory: this table can be called a relationship table, as it serves to define the physical inventory of films in various available shops. It therefore contains only identifiers and must be included in relationships.
Usually, if the physical data model is well defined, we should use at least N-1 relationships between N datasets included in the model.
You can access the Data Center Data Models section to see precisely this same example.