Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
uladzislau_pralat
Contributor
Sometimes you need to use exception aggregation result in subsequent exception aggregation in order to archive desired result with ABAP CDS view. It is possible with multiple exception aggregation steps.

In my example, I need to:

  1. Get a count of distinct Sales Documents

  2. Get average of number by Sales Documents by Sales Organization


The above 2 exception aggregation steps are translated into following ABAP CDS exception aggregation annotation:
  @AnalyticsDetails.query.axis: #COLUMNS
@EndUserText.label: 'Sales Document Avg by Sales Org'
@AnalyticsDetails.query.decimals: 0
@AnalyticsDetails: {
exceptionAggregationSteps: [
{ exceptionAggregationBehavior: #COUNT,
exceptionAggregationElements: ['SalesDocument'] },
{ exceptionAggregationBehavior: #AVG,
exceptionAggregationElements: ['SalesOrganization'] }
]
}
@AnalyticsDetails.query.formula: '1' 0 as SalesDocumentAvgBySalesOrg

Lets see it in action:


In first step number of distinct Sales Documents is calculated reducing context to just Sales Document, for example:


In second step number of Sales Documents is averaged out adding Sales Organization into context:


Complete ABAP CDS views source code can be downloaded from GitHub:

ZI_ExceptionAggregationCube

ZC_ExceptionAggregationQuery

 

 

 
14 Comments
Labels in this area