Skip to content

0. Star Schema

Andreas Riehl edited this page Nov 10, 2025 · 15 revisions

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++).

Cube View

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.

Example:
https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_flightcube.ddls.asddls

Dimension Views

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:

Hierarchies

Hierarchies enable the hierarchical display of dimension data (e.g., airports by region and country). A hierarchy consists of several artifacts:

  1. 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.
  2. 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

  3. 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

  4. 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.

Example:
https://github.com/SAP-samples/abap-platform-analytics-data-modeling/blob/main/src/%23dmo%23ana_i_airport.ddls.asddls

Further Reading:
https://community.sap.com/t5/technology-blog-posts-by-sap/cds-how-to-define-hierarchy-view/ba-p/13758059

Text Views

Text views provide language-dependent texts for dimension fields. They are annotated with @ObjectModel.dataCategory: #TEXT.

Text associations are defined using @ObjectModel.text.association.

Clone this wiki locally