SAP Knowledge Base Article - Public

2489701 - Data is not being aggregated in Custom CDS View results

Symptom

When creating a Custom CDS View and previewing it in "Custom CDS Views" or "Customer Data Browser" applications the fields are not aggregated even though the aggregation is correctly configured in "Element Properties". 

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Go to Custom CDS Views application
  2. Open your Custom CDS View
  3. Click on "Preview" or "Customer Data Browser" button 
  4. Data preview screen will not show the aggregation 

or 

  1. Go to Customer Data Browser app
  2. Go to "CDS Views" tab 
  3. Search for your Custom CDS View 
  4. Open the Custom CDS View 
  5. The results will not show the aggregation

Cause

This is expected behavior.

The Custom CDS View preview in Custom CDS Views or in Customer Data Browser apps itself doesn't support aggregation. Instead, is prepares for aggregation. This is because the CDS View preview result is only raw data, once that Custom CDS Views are intended to be used by external sources such as OData Services or Custom Analytical Queries. 

Preparing for aggregation means that you can set the (default) aggregation behaviour in the element properties tab. Be aware that you can only set the aggregation for elements that the system considers as numerical values. Otherwise, the possibility to set an (default) aggregation will be greyed out for that field element.

 

Resolution

If you want to see the values aggregated you need to consume your Custom CDS View for example by an OData Service or Custom Analytical Query.

Also, you need to ensure that you have defined the aggregation inside the "Element Properties" tab in your Custom CDS View. 

See Also

For more information, check the following documentations:

Keywords

CDS View, aggregation, custom, results, consume, not working, custom cds views, customer data browser, raw data, query, custom analytical queries, external API, odata service, aggregated , KBA , BC-SRV-APS-GKE , Generic CDS Key User Editor , BC-SRV-APS-CDB , Customer Data Browser , Problem

Product

SAP S/4HANA Cloud Public Edition all versions