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
- Go to Custom CDS Views application
- Open your Custom CDS View
- Click on "Preview" or "Customer Data Browser" button
- Data preview screen will not show the aggregation
or
- Go to Customer Data Browser app
- Go to "CDS Views" tab
- Search for your Custom CDS View
- Open the Custom CDS View
- 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
SAP Knowledge Base Article - Public