Show TOC

Trend-Criticality CalculationLocate this document in the navigation structure

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.

Figure 1: Example of visualization of trend-criticality calculation
You can use the following sub-annotations to calculate trends and derive from these calculation the criticality of data:
Sample Code
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.

Figure 2: Example of improvementDirection: #TARGET
Figure 3: Example of improvementDirection: # MINIMIZE
Figure 4: Example of improvementDirection: # MAXIMIZE
The properties of the sub-annotation @UI.dataPoint.criticalityCalculation can have either constant values or derive values from referencing to other elements. If a property references to another element, the suffix Element must be added to the name of the property.

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.

Example toleranceRangeLowValue becomes toleranceRangeLowValueElement.