Skip to Content
1
Dec 22, 2017 at 11:48 AM

Formula based on query CDS views, Exception Aggregation,

3230 Views

Hi all

I'm have a problem when i'm trying to create a KPI formula based on two indicator that have #sum exception aggregation behavior, based on one characteristic. When i do the formula i have the following error.

" Annotated formula for RPK_ASK: RPK_ cannot be used (only measures allowed) [Analytics]ZCDS_C_FLIGHTORDERCOSTANALYSIS (Data Definition)[SD1] ZCDS_C_FLIGHTORDERCOSTANALYSISline 698ABAP Syntax Check Problem"

How I can create this kind of measures? How could I create the exception aggregation behavior?

  @AnalyticsDetails.query.axis: #COLUMNS
  @AnalyticsDetails.query.hidden: true
  @EndUserText.label: 'RPK'
  //  @DefaultAggregation: #FORMULA
  @AnalyticsDetails.query.formula: 'RPK + 0'
  @AnalyticsDetails.exceptionAggregationSteps: [{
      exceptionAggregationBehavior: #SUM,
      exceptionAggregationElements: [ 'FlightOrder' ]
  }]
  1                                                                                            as RPK_,
  @AnalyticsDetails.query.axis: #COLUMNS
  @AnalyticsDetails.query.hidden: true
  @EndUserText.label: 'ASK'
  //  @DefaultAggregation: #FORMULA
  @AnalyticsDetails.query.formula: 'ASK + 0'
  @AnalyticsDetails.exceptionAggregationSteps: [{
      exceptionAggregationBehavior: #SUM,
      exceptionAggregationElements: [ 'FlightOrder' ]
  }]
  1                                                                                            as ASK_,
  @AnalyticsDetails.query.axis: #COLUMNS
  @EndUserText.label: 'RPK/ASK'
  @DefaultAggregation: #FORMULA
  @AnalyticsDetails.query.formula: 'NDIV0 (RPK_ / ASK_)'
  @AnalyticsDetails.exceptionAggregationSteps: [{
      exceptionAggregationBehavior: #SUM,
      exceptionAggregationElements: [ 'FlightOrder' ]
  }]


  1                                                                                            as RPK_ASK,

Thanks in advance.

Mikel.