CX Works

CX Works brings the most relevant leading practices to you.
It is a single portal of curated, field-tested and SAP-verified expertise for SAP Customer Experience solutions

Custom Analytics Content for SAP Marketing Cloud

13 min read

Custom Analytics Content for SAP Marketing Cloud

Do you have analytics and reporting needs which you want to realize? Have you checked the pre-delivered analytics content which gets enhanced with each release with new updates?   

In this article we are going to focus on the creation of custom analytics content for SAP Marketing Cloud. You will learn about the relevant extensibility objects, along with best practices to build performant custom analytics content.

Table of Contents


With Marketing Analytics, you can perform real time analysis of Marketing data such as campaign success, customer profiling or marketing planning data.

An introduction into this topic can be found in the article Overview about Marketing Analytics

Before Getting Started

After reading this article, you will know how to best create custom analytics content. However, before getting started you should check the pre-delivered analytics content first. 

Samples for Analytics Stories are provided as content packages through the Content Library of SAP Analytics Cloud. The SAP Analytics Cloud content package for Marketing gets enhanced with each release along with the most recent analytical capabilities from the SAP Analytics Cloud technologies.

Once you know the pre-delivered content, you can save efforts by directly using or re-using parts of the standard analytics content.

Always check the pre-delivered analytics content for direct use or re-use before building custom content.

More information can be found in the article Overview about Marketing Analytics

This article assumes that you already have specific analytics and reporting needs which are best documented in a structured way.

In a first step, you should identify all required data sources for your analytics scenario. Data sources can be standard business objects (e.g. campaigns, interactions, products), custom business objects or existing (standard or custom) analytics content. You can use the View Browser to check the released Analytical Data Sources.

Ideally you are able to map all dimensions and measures back to a core data source. This approach helps to identify any roadblocks (e.g. missing data) beforehand. 

Make sure you have all required data available for your analytics scenario.

Identify your data sources and map all dimensions and measures back to the data sources before building custom analytics content. 

For all analytics or non-analytics scenarios which heavily rely on data, the data quality should be checked before building custom content. 

In case the data is inaccurate, not up-to-date or partially incomplete, the resulting reports or stories can't show meaningful insights. You also won't be able to fix a bad data quality through your virtual data model.

Check the data quality by reviewing aspects such as completeness, accuracy, and timeliness of the data you are planning to use.  

Last but not least, make sure you know which apps are required for custom analytics content and how they are working. 

This article does not replicate the how-to step-by-step guides. 

Make sure you know the relevant how-to guides for analytics content, especially: 


All physical tables in SAP Marketing Cloud, containing standard objects or custom business objects, are part of the persistence layer. The extensions to build custom analytics content can be seen as the virtual data model layer on top of the persistence layer.

In the next chapter, the steps to build the virtual data model are explained.

Virtual Data Model in SAP Marketing Cloud

As described in the the Extensibility Overview for SAP Marketing Cloud article, the two main extensibility options on SAP Marketing Cloud for Analytics are Custom CDS Views and Custom Analytical Queries

Views and Queries can be further distinguished into the following objects: 

  • Basic views: Standard CDS views
  • Cube and dimension views: Standard or custom CDS views
  • Queries: Standard or custom analytical queries

The associations between these objects inside virtual and persistence layer of SAP Marketing Cloud are displayed in image 1 below. 

Please note that the Unified Modeling Language (UML) notation for associations is used within this article.

Examples in image 1: 

  • Each query is based on exactly one cube / dimension view
  • Each cube / dimension view can be used in one or many queries. 

Image 1: Associations of objects inside virtual and persistence layer of SAP Marketing Cloud

Basic Views

Basic views are the basic elements of the model and they are 1:1 representations of the physical tables from the SAP Marketing Cloud system. In the product documentation, these views are also referred to as released SAP VDM views

Cube and Dimension Views

Cube and dimension views are used to combine data from different basic views and they are meant to be reused. A cube view will always require at least one measure while dimensions are reflecting master data without any measures. Learn more about views in Custom CDS Views. 

With cube and dimension views one can build up an internal view hierarchy. You can use cube views or dimension views within further cube views and apply filters or rename fields for content standardization.

Filters are used to limit the result set of your view (similar to the SQL WHERE clause) and can be set either using an expression-based editor or the form-based editor. Please note that you can set filters to your primary data source only. Learn more about Filters or Creating Filters

It's important to filter the data as early as possible or in the early stages of your virtual data model. Also try to use filters on fields with strong selectivity first to reduce the data volume quickly. 

This best practice ensures that only relevant data is passed through the hierarchy - for example before performance-intensive tasks such as joins, aggregations or calculations are performed. 

You can also perform associations (joins), aggregations and calculations at the view level. 

Associations or joins are required to bring in fields that are not already part of the primary data source. Find more details in Join Condition or Maintaining the Join Condition. For aspects and considerations when joining multiple data sources with each other, please read the following blog post: Custom CDS Views – Using Multiple Data Sources

Aggregations are used to define the interpretation of numeric data. You must define an aggregation behavior for each numeric field in an analytical scenario. Please note that in the preview section of the Custom CDS Views app, you will not see any aggregated results and only the raw data. You will be able to see the aggregated results only in the analytical queries later. Learn more about aggregations in Element Properties

Calculations are required to derive new field values based on formulas. In formulas, conditions, string manipulations, and arithmetic calculations or a combination of those techniques can be defined. Find more details in Calculations or Functions for Calculated Fields

Try to avoid performance-intensive tasks if possiblePerformance-intensive tasks are associations (joins), aggregations and calculations.

Review your view before publishing in order to check that no unnecessary performance-intensive tasks are included. 

If required, perform performance-intensive tasks as late as possible or in later stages of your virtual data model, after filtering the data (see above). 

You can also use parameters to require data input when the view is executed. This data can then be used like a variable e.g. in filters, calculated fields or even in a join condition to another view. Learn more about parameters in Creating User-Defined Parameters.

You can also map parameters from associated data sources in your CDS view. Learn more about this in Maintaining Parameter Mapping of Data Sources.

When required, use parameters in order to make your view dynamic - e.g. to set filters dynamically, calculate fields dynamically or join different parts of associated views. 

In order to build complex scenarios, it might be possible to create a single or very few views which contains all logic that you may need.

However from a re-usability perspective, it makes sense to split the logic into multiple views, where one view references the next. The goal of this approach is to simplify and decouple the logic into smaller re-usable pieces. 

Take a modular approach and try to simplify and de-couple the logic into re-usable pieces.

Analytical Queries

Analytical queries are exposed to the application, for example for operational reporting or within a SAP Analytics Cloud model.

In a nutshell, analytical queries take the raw results from your underlying views and transform these into a grid without having to know a query language such as SQL. Learn more about analytical queries in Custom Analytical Queries.

You have multiple options available inside analytical queries: 

  • Select dimensions and measures from the data source
  • Adding counters
  • Define restricted or calculated measures based on the data source's measures
  • Defining filters (single or multi-selection)
  • Set parameters of underlying views

Apply filters in analytical queries only if it was not possible to push down the filter to the underlying views (see above). 

Apart from these options you can also set the "Maximum processing effort" for this query. Some queries are expected to take more time/effort for execution. Please review and refactor these queries according to the guidelines in this article. 

Set the "Maximum processing effort" option very carefully. If possible, you should avoid setting it to "Max" or "Full". 

This setting might lead to a consumption of a lot of resources which will effect the resources available for other application areas such as campaign execution. 

Consuming Custom Queries in SAP Analytics Cloud

Once you created and published your custom analytical query, you can create an analytical application, assign it to a catalog and published the analytical application using the View Browser. 

After that you can start accessing the queries and building your content in SAP Analytics Cloud. Please note that you can also build custom stories on standard queries, for example if you want to expose additional dimensions in those pre-delivered queries. 

The two most important objects in SAP Analytics Cloud for the SAP Marketing Cloud integration are model and story


A model is a representation of the business data of an organization or business segment. 

As shown in the image below, each model has a 1:1 relationship to a query in SAP Marketing Cloud. All models towards SAP Marketing Cloud will use a Live Data Connection to fetch the data "live" meaning that when a user opens a story in SAP Analytics Cloud, changes made to the data in the source system are reflected immediately.

Find more details in Models and in Live Data Connection.


A story is a presentation-style document that uses charts, visualizations, text, images, and pictograms to effectively present the data. 

One story can use one or multiple models inside it to build charts, visualizations, text, images, and pictograms on top of the selected models.

Image 2: Associations of objects at the interface between SAP Analytics Cloud and SAP Marketing Cloud

With regards to best practices to build performant SAP Analytics Cloud stories, the SAP Analytics Cloud blogs are a great source. 

Check out the Blog post Best Practices for Performance which describes best practices around topics such as modeling and data, story design or filtering. This blog post is updated continually. 

Additionally, the Story Performance Tips & Tricks Webinar provides a lot of insights into this topic. 

Last but not least, if you face performance issues on SAP Analytics Cloud, for example refresh quality, slowness or long waiting times, there is a very useful SAP support note which contains troubleshooting hints. 

For performance issues in SAP Analytics Cloud, please review the SAP Note Troubleshooting performance issues in SAP Analytics Cloud *** Master KBA ***.

Please note that you need a SAP S-User in order to view this SAP Note.


This article introduced you to best practices in building custom content for analytical purposes. This article did not replicate any how-to step-by-step guides but it contains many links for further recommended reads. 

You have learned how the relevant extensibility objects work conceptually, along with best practices to build performant custom analytics content.

For an introduction into the topic, please check out the article Overview about Marketing Analytics

If you're interested in learning more about our services and recommendations, view our Portfolio of Services