Get information about how to use data points to calculate and display trend-criticality relations.
Another way to specify properties of criticality and trend is to define rules for criticality and trend within the UI annotation @UI.dataPoint.
... define view ZExample_SalesOrdersByCustomer as select from ... as so { key so.buyer_guid as BuyerGuid, @Semantics.currencyCode: true so.currency_code as CurrencyCode, @UI.dataPoint: { title: 'Gross Amount', targetValue: 9216, criticalityCalculation: { improvementDirection: #TARGET, toleranceRangeLowValue: 9200, toleranceRangeHighValue: 9300, deviationRangeLowValue: 8800, deviationRangeHighValue: 9700 }, trendCalculation: { referenceValue: 'ReferenceAmount', -- Reference to element isRelativeDifference: false, -- Comparison of difference strongUpDifference: 100, upDifference: 10, downDifference: -10, strongDownDifference: -100 } } @Semantics.amount.currencyCode: 'CurrencyCode' so.target_amount as TargetAmount, @Semantics.amount.currencyCode: 'CurrencyCode' so.reference_amount as ReferenceAmount }
For the criticality calculation, the value of the property improvementDirection is crucial because this value determines what further properties are needed. If, for example, the value is #MINIMIZE, the properties ToleranceRangeHighValue and DeviationRangeHighValue are relevant.
This also applies to the properties of the sub-annotation @UI.dataPoint.trendCalculation, except for the property referenceValue. This property always references to another element.