Naoto Amari
Naoto Amari

Reputation: 175

Count_distinct in analyticsDetails abap cds consumption view

I have a little problem, but I don't know what it is. I created a consumption CDS view and it works fine, but I'm trying to count one field with a condition.

This is my code:

@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Modelo ventas Sellout'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
    serviceQuality: #X,
    sizeCategory: #XXL,
    dataClass: #MIXED
}
@Metadata.allowExtensions: true
@Search.searchable: true

@VDM.viewType: #CONSUMPTION
@OData.publish: true
@Analytics: {
    dataExtraction.enabled: true,
    query: true
}

define view entity Z_M_SELLOUT_VD
  as select from Z_M_SELLOUT_VD_2
{ ... 
@EndUserText.label: 'distinc_kunag_flagMonto'
      @AnalyticsDetails.query.axis: #FREE
      @AnalyticsDetails.query.formula: 'case when flagMonto = 1 then 1 else 0 end'
      @AnalyticsDetails.exceptionAggregationSteps: [{ exceptionAggregationBehavior: #COUNT_DISTINCT, exceptionAggregationElements: [ 'kunag' ] }]
      1 as zconbert78
}

And I get this error: enter image description here

If I change #COUNT_DISTINCT with #COUNT, I don't get this error, but I need #COUNT_DISTINCT. Any ideas? I would appreciate it a lot!

Upvotes: 0

Views: 263

Answers (0)

Related Questions