Creating a basic Data Mart based on a classic star schema with SAP Data Warehouse Cloud


Introduction:

One of the purposes of cloud software is to simplify, empower and enable all non-IT users with all about the benefits of corporate software investments, focusing on the “functional aspect” rather than all the challenges involved through new software implementation.

https://learning.sap-press.com/sap-and-the-cloud

SAP Data Warehouse Cloud continues using classic “measures and dimensions” concepts as the foundation for the highest level objects(“Model consumption” and “Perspectives”) also there exist some specialized roles in the data warehousing life cycle(data warehousing techniques, Non-relational DBMS, Multidimensional Models, ETL processes, connections, etc), that means that the technical layer (Data Builder, Data Integration, Connections, and Configuration ) have to be done under best practices and using the most widely accepted techniques.

https://www.sap.com/insights/what-is-a-data-warehouse.html

next, we are going to use a classic data warehousing approach to easily construct a basic data mart (“Consumption model” and “Perspective”) based on a classic star schema located under the Data Builder of SAP Data Warehouse Cloud since here is where all required data engineering gets performed.

Prerequisites:

  1. You have a SAP Data Warehouse Cloud Tenant
  2. You have your own Space
  3. You have constructed a star schema(measures and dimensions associated with keys) located under Data Builder, in case you do not have one please check: https://blogs.sap.com/2020/01/18/my-first-story-with-sap-datawarehouse-cloud/

Creating Dimensions:

  1. Log- On to your SAP Data Warehouse Cloud Tenant
  2. Hit the Business Builder

accessing%20to%20Data%20Builder

accessing to Business Builder

Here is where you can define/reuse your dimensions from Data Builder:

defining%20dimensions%201

defining dimensions

Next, choose the dimension, it should exist deployed as View Dimension in the Data Builder layer, commonly time dimension is ever required in data warehousing(repeat steps for all dimensions needed):

selecting%20deployed%20View%20Dimension

selecting deployed View Dimension

If the dimension is correctly defined and under best practices for data warehousing, SAP Data Warehouse Cloud will detect its attributes and key definitions, it is very relevant since data relations of our multidimensional model(data mart) and every data warehouse using best practices should be defined by these key definitions. next confirm attributes and key definition auto-detection:

Auto%20Detection%20feature

Auto Detection feature

Finally, verify your attributes and key definitions, set your dimension as “Ready to Use” and save it:

saving%20dimension

saving dimension

repeat all previous steps for all dimensions needed

Creating measures (Analytic Set):

Click on New Analytical Dataset:

6

New Analytic Dataset 1

Next, select the corresponding Analytic Dataset containing measures and data relations to dimensions, it should exist deployed as Analytic Dataset(Business Entity) in the Data Builder layer

7

V_F_Ingreso – Analytical Dataset

if the Dataset is correctly defined and under best practices for data warehousing, SAP Data Warehouse Cloud will detect its attributes, key definitions, and measures, it is very relevant since data relations of our multidimensional model(Data Mart) and every data warehouse should be defined by these key definitions. next confirm properties detected:

8

Properties

Finally, verify your attributes, measures, and key definitions, set your Dataset as “Ready to Use” and save it:

9

Saving Dataset

Next, we need to define data associations between measures and dimensions, click on “Associations” and click on add icon:

10

Associations

Select the required dimension and click on Apply:

11

selecting dimension

Now click on Foreign Key Field, and select that one corresponding with the foreign key field located in the respective dimension, remember key relations is a common and widely used method for data warehousing construction:

12

Foreign Key

Immediately an auto validation process is launched:

13

validation process

We will get 100% validation if data association integrity is correctly defined, it means that for every record in fac table(measures) exists at least one record in the dimension table, after that save it.

14

validation success

Creating Fact Model:

From here we will full define our classic star schema-based data mart, click on” New Fact Mode”:

15

New fact Model

Define a name for your model and click on step 2:16

Fact Model Name

Select your Analytic Dataset defined previously in the “Creating measures (Analytic Set)” section:

17

Dataset selection

Next, a diagram with the associated objects will be displayed, check that there exist all the objects involved in your model, next proceed to include all the attributes that exist under the associated dimensions, click on add icon:

adding attributes

Select the corresponding dimension:

19

dimension selection

To continue click on step 3

20

Step 3

Next click on “Link Association Path”:

21

Link Association Path 1

next, the dimension view should be inside our fact view indicating that attribute for that dimension is now available for use, click on “create”:

22

Link Association Path 2

Finally, verify that now our dimension is listed in the “Dimension Sources” section:

23

Dimension Sources

Continue clicking on “Attributes” and select all available attributes, repeat all previous steps for all other dimensions related to the fact table in order to complete all attributes:

selecting attributes

when completed all dimension attributes association verify the final list:

25

attributes list

Change the Status to “Ready to Use”  and save it:

26

Changing Status

Finally, we need to expose the dimensions associated with our fact model when constructing the Consumption Model and Perspective, click on “Exposed Dimension Sources” and select the corresponding dimensions:

27

Exposed Dimension Sources

Repeat steps for all required exposed dimensions required:

28

Exposed Dimension

Finally, check measures, attributes, and Exposed Dimension Sources sections to verify that everything is correctly defined

29

Measures, Attributes, and Exposed Dimension Sources sections

Creating Consumption Model:

At this point, we have constructed a basic data mart under a classic approach, however, there is missing security, and consumption best practices to fit most of the analytics solutions in the nowadays market, that’s the case of SAP Analytics Cloud and others, to do so, finally, we will construct a Consumption Model, it is very similar to Fact Model but with some relevant differences:

Click on “New Consumption Model”

20

New Consumption Model

Select base model fact, click on “on step 3” and “create”:

31

Fact Source

In the “General” section enable “Public Data Access”:

32

Public Data Access

In the “Source Model” section, add and choose the dimension created previously under the “Creating Dimensions” sections:

33

Choosing Dimensions(Business Entity)

Again as in previous sections, click on “Link Association Path” and repeat this step for all required dimensions:

34

Link Association Path

Continue clicking on “Attributes” and “Measures” and select all available attributes/measures:

35

available attributes/measures

Creating Perspective:

Go to the “Perspective” section, define a significant name for your “Perspective” and select all available Measures and Attributes that also enable “Run in Analytical Mode” and click on “Deploy”:

36

Perspective

As the last step, verify that all your constructed objects look similar to the next list image:

37

List Objects

Finally, to validate the correct creation of all about our model, launch the Story Builder and verify there is listed our “Perspective” constructed all previous steps through.

38

Story Creation Screen

Conclusion:

This blog covers a very simple model, with just a measure and two-dimension focusing on the steps, in the end, basic examples always let us go from the simple to the complex.

thank you for readyng.

Please follow me for more related blogs

https://community.sap.com/topics/data-warehouse-cloud/best-practices-troubleshooting