Show TOC

TrendsLocate this document in the navigation structure

Get information about how to use data points to display trends on SAP Fiori UIs.

Data can be defined as being either increasing, decreasing, or stable. These data can be measured over a certain period of time and visualized on the UI.

You can use the following sub-annotations to highlight trends:
  • @UI.dataPoint.trend
    Example For an example, see the example code in section Criticality linked below.
  • @UI.dataPoint.trendCalculation
    Example The table below lists the values that are valid for the UI annotation @UI.dataPoint.trendCalculation, and shows how these values are visualized on the UI:
    Table 1: Values and Visualization of Trend

    Value

    Description

    Visualization

    1

    Strong up

    2

    Up

    3

    Sideways

    4

    Down

    5

    Strong down

    For the trend calculation, the flag isRelativeDifference indicates whether the absolute or the relative difference between the actual value and the reference value is used to calculate the trend.

    Figure 1: Visualization of trend calculation
    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',
        //...
        trendCalculation: {
          referenceValue: 'ReferenceAmount',	-- Reference to element
          isRelativeDifference: true,		-- Comparison of ratio
          strongUpDifference: 1.25,
          upDifference: 1.1,
          downDifference: 0.9,
          strongDownDifference: 0.75
        }
      }  
      @Semantics.amount.currencyCode: 'CurrencyCode'
      so.target_amount as TargetAmount,
    
      @Semantics.amount.currencyCode: 'CurrencyCode'
      so.reference_amount as ReferenceAmount
    }