Working with Analytic Models

Objective

After completing this lesson, you will be able to use analytic models in SAP Datasphere.

Analytic Models

Now that the inbound layer, harmonization layer and propagation layer have been covered, let's explore reporting. Let's see how analytic models are used in SAP Datasphere.

Creating Analytic Models

Screen capture of the Data Builder showing an Analytic Model.

Analytic models are the analytical foundation to make data ready for consumption. They support multi-dimensional analytical purposes to answer different business questions. Predefined measures, hierarchies, filters, parameters and associations provide a flexible and easy to use navigation through the underlying data.

Analytic models offer:

  • Analytical capabilities to answer complex business questions, using features like:

    • Time-dependent dimensions, texts and hierarchies
    • Structures with calculated and restricted measures
    • Exception aggregation
    • Currency conversion
    • Variables
  • Consumption of data layer objects (fact views) with nested dimensions.

  • Re-use of source objects, reducing efforts and the number of objects to maintain.

  • Control of output due to the modeling and pruning of attributes and measures to optimize performance.

  • Unlimited stacking of analytic models.

  • Repository integration (for impact and lineage analysis, CSN export/import & ACN transports).

  • Analytical preview.

  • Support of data democratization and self-service analytics strategies as business oriented users can easily create models.

  • Sharing option to another space, and even multiple spaces. You can then create a new analytic model on top of that in order to consume this model from other spaces.

Note

Ideas for many features for the analytic model are derived from existing BW Query features. When you import a model from a BW Query, an analytic model will be created.
Screen capture of an analytic model. Dimensions and Measures are taken from fact source. The source can be replaced by drag and drop. There is a plus icon to create new measures. There is a button to create another analytic model on top. There is a button to start a full analytic data preview

With the Create Analytic Model button, you can easily create as many analytic models on top of an existing analytic model or fact view as you like to reuse its measures and attributes.

Associated dimensions of the underlying models are automatically added, but modelers of analytic models can select ("prune") which dimensions and attributes to expose. All nested dimensions are offered on the top-level of the SAP Analytics Cloud dimension dialog. Their node name is taken from the respective source field.

By dragging a different source object on top of the fact source node in the graphical editor, you can replace the fact source. To replace a dimension, you must remove it, adjust the association in the underlying model, and add the dimension again in the analytic model.

A filter in an analytic model restricts the rows of data that the model returns. Filters affect all measures and are applied before aggregation.

A restricted measure restricts values of a measure based on a filter condition. You can restrict by multiple dimensions at once. Restricted measures can be built on any other measure, not only fact source measure ("measure stacking").

A calculated measure is a measure derived by applying a formula to existing measures. It is calculated after aggregation.

Relational datasets or fact views only offer a relational data viewer (for example by record), forcing users to build a SAP Analytics Cloud story to check their data and modeling. Analytic models have a built-in analytical Data Viewer with rich attribute/measure selection, filtering and pivoting, hierarchy support and many more features.

Variables are Standard Variables, Restriction variables, or Filter variables.

Variables are used within analytic models to make queries and reports dynamic, allowing users or the system to supply values at runtime.

The following variables are available:

  • Standard variable: a value, entered by the user or derived automatically, feeds the input parameter that the underlying fact source (view) requires in order to run.
  • Filter variable: applies a global filter across the entire analytic model. It is linked to a dimension attribute.
  • Restriction variable: a restricted measure variable is used in the filter condition of a restricted measure. It can be applied only in restricted measures, and does not filter the entire data.
  • Reference date variable: when the analytic model has associations to a time-dependent dimension or text table, you can define a reference date variable to filter the data using a specific date.

Values of variables are determined at run-time by one of the following options:

  • Direct user input
  • Derived from another model
  • User input with a default value from another model

Create an Analytic Model

Scenario Overview

Let's have a look at the scenario overview:

The figure shows an overview of all objects to be created in the sales data scenario.

You have to create an analytic model on your fact view. Within the analytic model, you have to define a restricted measure and a calculated measure.

The creation of an analytic model is divided into two simulations (parts 1 and 2).

In the following simulation, part 1 is covered.

In the following simulation, part 2 is covered.