sisense.com
✅ You are viewing documentation for the latest version of Compose SDK.
Version:

Function trend

trend( measure, name?, options?): CalculatedMeasure

Creates a calculated measure that computes a specified trend type for a given measure.

The trend types include linear (the default), logarithmic, advanced smoothing, and local estimates. You can also opt to automatically identify and ignore anomalous values in the series.

Trend requires a Sisense instance version of L2023.6.0 or greater.

Parameters

ParameterTypeDescription
measureMeasureMeasure to apply the trend logic to
name?stringName for the new measure
options?TrendFormulaOptionsTrend options

Returns

CalculatedMeasure

A calculated measure instance

Example

Calculate the trend in total cost from the Sample Ecommerce data model.

measureFactory.trend(
  measureFactory.sum(DM.Commerce.Cost),
  'Total Cost Trend',
  {
    modelType: 'advancedSmoothing',
    ignoreAnomalies: true,
  }
)
Last Updated: