-
Notifications
You must be signed in to change notification settings - Fork 4
0. Star Schema
The star or snowflake schema forms the analytical model that will be used in analytical queries. In this chapter (0), we introduce all related development artifacts before applying the model in various analytical queries in the following chapters (1++).
The cube is the core of the analytical model. It consolidates all required measures and dimensions and defines the model’s functionality.
The cube view is a view entity annotated with @Analytics.dataCategory: #CUBE.
Dimension fields in the cube view contain only IDs (e.g., airline ID). Additional attributes (such as airline name and city) are provided by dimension views.
A dimension view is a view entity annotated with@Analytics.dataCategory: #DIMENSION.
It is referenced in the cube view using @ObjectModel.foreignKey.association.
Examples:
- City: https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_city.ddls.asddls
- Connection: https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_connection.ddls.asddls
- Airport: https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_airport.ddls.asddls
- Carrier (Airline): https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_carrier.ddls.asddls
Hierarchies enable the hierarchical display of dimension data (e.g., airports by region and country). A hierarchy consists of several artifacts:
-
Hierarchy Directory View
Acts as a directory for hierarchy variants.
Example: https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_airporthierdir.ddls.asddls- Variant 1: Geographical grouping (World → Region → Country → Airport)
- Variant 2: Alphabetical grouping (similar to an address book)
Contains header information such as ID and text.
-
Hierarchy Base View
Defines the hierarchy by establishing parent-child relationships via self-association, linking the directory view, and associating dimension and text views.
Example: https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_p_airporthierbase.ddls.asddls -
Hierarchy Definition
Constitutes the hierarchy using the base view as a source and arranges elements semantically.
Example: https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_airporthier.ddls.asddls -
Hierarchy Node View
Lists all hierarchy nodes used in different variants. Optional in the base view for defining node types.
Example: https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_airporthiernode.ddls.asddls
Finally, the hierarchy is referenced in a dimension view using @ObjectModel.association.toHierarchy.
Further Reading:
https://community.sap.com/t5/technology-blog-posts-by-sap/cds-how-to-define-hierarchy-view/ba-p/13758059
Text views provide language-dependent texts for dimension fields. They are annotated with @ObjectModel.dataCategory: #TEXT.
Text associations are defined using @ObjectModel.text.association.