Trend and Forecasting
The Trend and Forecasting function calculates a regression line or line of best fit. When applied to a time series, it can forecast future values.
This function can be used with a measure and date/time values, or with two measures where each is typically plotted along a separate chart axis.
There are four regression functions available:
Trend and Forecasting:
Upper Band Error:
Lower Band Error:
The Trend and Forecasting functions require the following input series:
- d0 - Trend Axis values - The set of values on the trending axis (e.g. datetime axis).
- d1 - Input data values - The set of historical data values to be used in the Trend and Forecasting formula.
- s0 - Regression Type - The type of regression function used by the Trend and Forecasting formula. Available choices include:
- 0 - Linear (default)
- 1 - Exponential
- 2 - Logarithmic
- 3 - Power
- s1 - Regression Degree - The degree used by the regression function in calculating the Trend and Forecasting formula. Default value is 2.
- s2 - Forecasting Period - The length of the forecasted data series as returned by the Trend and Forecasting formula. Available choices include:
- 0 - No Forecast
- 1 - Tenth Input
- 2 - Quarter Input
- 3 - Half Input (default)
- 4 - Full Input
The Trend and Forecasting functions generate the following outputs:
- Trend and Forecasting - The Trend and Forecasting result set.
- Upper Band Error - The upper error boundary based on standard deviation and the forecasting error.
- Lower Band Error - The lower error boundary based on standard deviation and the forecasting error.
This example shows how to use the TRENDFORE function on a scatter plot chart. The dashboard editor is pictured below, but similar steps can be followed when editing a metric set.
First, create a new dashboard and add a Scatter Plot data visualization from the toolbar.
Add two measures (e.g., LineTotal, OrderQty) and one row hierarchy (e.g., OrderDate).
With the chart selected on the canvas, go to the toolbar, click Data Tools, and then select Add Formula.
In the formula bar, enter the TRENDFORE function and use the two measures as arguments.
Click output and choose the line chart type. (You can also right-click the new series later and re-visualize it to Line instead.)
Click apply when finished.
- The forecast will only go ahead in time as far as the time dimension's end date.
7. See also