Page tree
Skip to end of metadata
Go to start of metadata

With the annotation @Analytics.settings.zeroValues, the CDS query as below suppresses the rows or columns that are all zeros (see discussion of this OLAP feature in Zero Suppression):

@AbapCatalog.sqlViewName: 'ZGLSUM_Q2V'
@EndUserText.label: 'zero suppression'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Analytics.query: true

//===zero suppression section begins ===
@Analytics.settings.zeroValues: {
handling: #HIDE_IF_ALL,
hideOnAxis: #ROWS_COLUMNS
}
//===zero suppression section ends ===
@OData.publish: true

define view ZGLSUM_Q2 as select from ZGLSUM
{
@AnalyticsDetails.query.axis: #ROWS
@AnalyticsDetails.query.display: #TEXT_KEY
name,
@AnalyticsDetails.query.axis: #FREE
activity,
@AnalyticsDetails.query.axis: #COLUMNS
times,
@AnalyticsDetails.query.axis: #COLUMNS
ToysNum
}
where name <> 'SNOOPY'

Run the query, the result is:

After set filter as Kids = CHARLIE, TINKERBELL,  the column ToyCount is suppressed as it contains only zeros:

With active  feature Zero Suppression, a query with many zero cells can have a smaller result set, thus less data is transferred to frontend.

See also



  • No labels

1 Comment

  1. @Analytics.settings.zeroValues: {handling: #HIDE_IF_ALL,hideOnAxis: #ROWS_COLUMNS}
    check more possible values in Eclipse →ABAP perspective