CDS: How to use AnalyticsDetails.query.ignoreFurtherFilter in Analytical query (Constant Selection)

Estimated read time 4 min read

This blog is about how to use @ AnalyticsDetails.query.ignoreFurtherFilter in Analytical query to define a constant selection as like in BW query (see Note  944815).

‘Ignore filter’ is a property that influences the effect of filters on cells, in classic BW it is called as ‘Constant selection’. It is used to define a selection in query definition as fixed value. Navigation and filters then have no effect on this selection at runtime.

This feature is useful to calculate e.g., Market Index.  More information about constant selection can be found Constant Selection | SAP Help Portal

 

@ AnalyticsDetails.query.ignoreFurtherFilter

annotation is used to model ‘constant selection’ in the Analytical Engine.

The value of each cell in a query result set is determined by different filters acting on this cell. These filters are from the structure element or key figures itself or global filters and drill down.  

Sometimes there is a need that not all filters should be applied, therefore with this annotation filters on certain dimensions or on all dimensions can be excluded.

@AnalyticsDetails.query.ignoreFurtherFilter.forElement: Global filters and filters from drill down will not be applied on the structure element for the elements listed in the array.

@AnalyticsDetails.query.ignoreFurtherFilter.forAllElements: No global filters and no filter from drill down will be applied on the structure element.

 

Example

 

@AccessControl.authorizationCheck: #NOT_ALLOWED
@EndUserText.label: ‘IGNOREFILTER- constant selection’
@ObjectModel.modelingPattern: #ANALYTICAL_QUERY
@ObjectModel.supportedCapabilities: [#ANALYTICAL_QUERY]
define transient view entity ZLR_PC_IGNOREFILTER1
provider contract analytical_query
as projection on ZDMO_I_FLIGHTCUBE
{

@AnalyticsDetails.query.axis: #ROWS
AirlineID,

@AnalyticsDetails.query.axis: #ROWS
@AnalyticsDetails.query.totals: #SHOW
ConnectionID,

CurrencyCode,

@EndUserText.label: ‘Price in 2024 ‘
@Semantics.amount.currencyCode: ‘CurrencyCode’
case when FlightYear = ‘2024’ then Price else null end as priceIn2024_without,

@EndUserText.label: ‘Price in 2024 for Airline’
@Semantics.amount.currencyCode: ‘CurrencyCode’
@AnalyticsDetails.query.ignoreFurtherFilter.forElement: [‘ConnectionID’ ]
case when FlightYear = ‘2024’ then Price else null end as priceIn2024

}
where AirlineID = ‘AA’ or AirlineID = ‘AZ’

 

Output

In the above example column ‘Price in 2024 for Airline’ shows the total price for airline, as ‘ConnectionID’ filter is ignored with annotation @AnalyticsDetails.query.ignoreFurtherFilter.forElement: [‘ConnectionID’ ]

Constraint

This feature is only available in Analytical query

 

​ This blog is about how to use @ AnalyticsDetails.query.ignoreFurtherFilter in Analytical query to define a constant selection as like in BW query (see Note  944815).‘Ignore filter’ is a property that influences the effect of filters on cells, in classic BW it is called as ‘Constant selection’. It is used to define a selection in query definition as fixed value. Navigation and filters then have no effect on this selection at runtime.This feature is useful to calculate e.g., Market Index.  More information about constant selection can be found Constant Selection | SAP Help Portal @ AnalyticsDetails.query.ignoreFurtherFilter annotation is used to model ‘constant selection’ in the Analytical Engine.The value of each cell in a query result set is determined by different filters acting on this cell. These filters are from the structure element or key figures itself or global filters and drill down.  Sometimes there is a need that not all filters should be applied, therefore with this annotation filters on certain dimensions or on all dimensions can be excluded.@AnalyticsDetails.query.ignoreFurtherFilter.forElement: Global filters and filters from drill down will not be applied on the structure element for the elements listed in the array.@AnalyticsDetails.query.ignoreFurtherFilter.forAllElements: No global filters and no filter from drill down will be applied on the structure element. Example @AccessControl.authorizationCheck: #NOT_ALLOWED
@EndUserText.label: ‘IGNOREFILTER- constant selection’
@ObjectModel.modelingPattern: #ANALYTICAL_QUERY
@ObjectModel.supportedCapabilities: [#ANALYTICAL_QUERY]
define transient view entity ZLR_PC_IGNOREFILTER1
provider contract analytical_query
as projection on ZDMO_I_FLIGHTCUBE
{

@AnalyticsDetails.query.axis: #ROWS
AirlineID,

@AnalyticsDetails.query.axis: #ROWS
@AnalyticsDetails.query.totals: #SHOW
ConnectionID,

CurrencyCode,

@EndUserText.label: ‘Price in 2024 ‘
@Semantics.amount.currencyCode: ‘CurrencyCode’
case when FlightYear = ‘2024’ then Price else null end as priceIn2024_without,

@EndUserText.label: ‘Price in 2024 for Airline’
@Semantics.amount.currencyCode: ‘CurrencyCode’
@AnalyticsDetails.query.ignoreFurtherFilter.forElement: [‘ConnectionID’ ]
case when FlightYear = ‘2024’ then Price else null end as priceIn2024

}
where AirlineID = ‘AA’ or AirlineID = ‘AZ’ Output In the above example column ‘Price in 2024 for Airline’ shows the total price for airline, as ‘ConnectionID’ filter is ignored with annotation @AnalyticsDetails.query.ignoreFurtherFilter.forElement: [‘ConnectionID’ ]ConstraintThis feature is only available in Analytical query   Read More Technology Blogs by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author