Forecasting is a result manipulation that uses patterns in your data to predict future results.
Forecasting uses values from date fields with at least two cycles of data. A cycle of data is a period broken down into multiple values. For example, a year is broken down by month or week. In auto-mode, the forecast will recognize each year as a cycle, so you need two years of data to generate a forecast.
This article contains the following topics:
Forecasting basics
Use this procedure to learn how to add a forecast to your query.
To add a forecast to your query
- In Query builder, create a time-based query. For example, you could add COUNT(Tickets) to the Metrics panel and Ticket created - Year to the Columns panel.
- Click the result manipulation icon (), then click Forecast.
- In the Forecast menu, check Calculate a forecast on the result
The options to configure forecasting are displayed.
- Path determines whether the forecast is based on the columns, or the rows in your chart. Whichever you choose must contain a date-based attribute. The path always contains the date-based attribute for your forecast.
- Under Method, choose either Additive trend and multiplicative season or Additive trend and additive season.
To learn more about the forecasting methods you can use, see How forecasting works below.
- Under Values to predict, choose one of the following:
- Auto: Let Explore automatically calculate the optimum number of values ahead to predict.
- Custom: Specify the number of values to look ahead. For example, if you're attribute is year based, you'll specify the number of years you want to forecast ahead.
- Under Values per cycle, you can configure the number of data points you include in each cycle. For example, for 12 months of data, you can select 6 values per cycle. If you select Auto, Explore calculates the optimum number of values to use.
- When you are finished, click Apply.
- From the visualization menu (), choose either a bar, column, area, line, or sparkline chart. Forecast results are not displayed on other chart types.
The forecasted porting of the chart is shown in a different style. For example, the forecasted portion of a line chart is shown as a dotted line, for example:
For example, if your query contains the attribute Ticket created - Month and you have been collecting data for over a year, then the values in this field are aggregated and you'll see the error message. Add the attribute Ticket created - Year also to resolve the error.
How forecasting works (advanced)
The forecasting method that Explore uses is based on the Holt winters model, which is a triple exponential smoothing that relies on the level, the trend, and the season of a time series.
Explore, uses two sub-models that fit most use-cases, and also take into account seasonal variations.
The AA method
The AA (Additive trend and Additive season) model is the default because it is the most commonly used, and produces the most realistic results.
Initial values are processed with the formula below:
Then, we can apply the Holt Winters AA model:
The AM method
The AM (Additive trend and Multiplicative season) model is, in some cases, a time-based trend.
Initial values are processed with the formula below:
Then, we can apply the Holt Winters AM model:
Periods per cycle
In the calculation, we also use the value “Periods per cycle”. It is used to determine the length of a season, needed to process seasonal indices. In the formulas above, this value is named “h”.
Smoothing parameters
Three other parameters must be defined before the processing of the forecast. They correspond to smoothing parameters, called “α” for the level, “β” for the trend, “γ” for the seasonality. In brief, they correspond to a ratio of the importance given to the firsts and lasts values of the time-based series, and will influence the results of each period. Here is an example:
“The estimated values of alpha, beta and gamma are 0.41, 0.00, and 0.96, respectively. The value of alpha (0.41) is relatively low, indicating that the estimate of the level at the current time point is based upon both recent observations and some observations in the more distant past. The value of beta is 0.00, indicating that the estimate of the slope b of the trend component is not updated over the time series, and instead is set equal to its initial value. This makes good intuitive sense, as the level changes quite a bit over the time series, but the slope b of the trend component remains roughly the same. In contrast, the value of gamma (0.96) is high, indicating that the estimate of the seasonal component at the current time point is just based upon very recent observations.”
For the three optimization parameters, there is no official algorithm to find the best ones. This turns into a NP-Complete problem, where the optimization problem is to minimize the mean squared error of the forecasted results, with 0≤α≤1, 0≤β≤1, 0≤γ≤1.
Thus, Explore has its own algorithm to find in a linear time the best three parameters, with an accuracy of 0.01.
23 Comments
I'm very interested in this 'forecast' function, and may I have a rough picture on what is the mechanism of this predicting function?
Kind of what Daniel's asking as well, I'd like more in depth info on how "Additive trend and multiplicative season or Additive trend and additive season method options" work and differ from each other.
Hi Ryan, I'm digging into this question, and I'll try and get you an answer and update the docs as soon as I can.
Hi again Ryan, I received some quite in-depth information about how forecasting works, and have added it to a section at the end of the article. I hope this helps, but if you have any problems, do let us know. Thanks! - Rob
Great, thanks Rob. Some of it's a little over my head as an admin, but it definitely gives me more to go on, especially so I can communicate it to and work with our own internal analytics and reporting teams!
Hi! My team was so excited about this feature, but we're having a really hard time getting it to work. We keep getting the error "forecast error year missing. If we're just trying to predict tickets created by week, and we have at least 2 years of data, what is the error referring to?
Hi Emma, I've opened a ticket on your behalf so somebody can look at your issue more closely. I'll be sure to update the docs if necessary once this ticket is resolved.
Thank you, Rob! Appreciate your quick action!
I'm also getting the "forecast_error_year_missing" message that Emma mentioned while trying to look at tickets created per month thus far, and using that to forecast tickets per month for the remainder of the year.
Hello Jasen,
I went ahead and ran some tests to see if the following would suffice as a solution to your error and I'm happy to report the instructions below should resolve your issue.
So when you are using date levels, it's essential to make sure that you have all the appropriate levels in the query for the results to be accurate - and in the right order! If you use [month of year] and you have more than one year of data, the results will be aggregated - i.e., month 1 will show results for month 1 2018, and 2019 added together.
For this reason, you also need to use the [year] level on the query, before the [month], to split everything out and keep it in the right order.
Hope this clears things up a bit and let me know if you need anything else clarified further.
Awesome, thanks Devan! That worked for using all-time data, but if I try to forecast using only 2019 thus far (or 2018-2019), I get a new error that says "You need to have data for at least 2 cycles to forecast your result. Your current cycle length is 24." Any tips for that?
Hi Jasen,
Could you send me a screenshot of the settings you are selecting so I can run this buy one of our experts and see exactly where is mishap is taking place?
Is there any advice on how to get an external metric (for example "# of our app active users") into Zendesk to use this for forecasting? Would be interesting since our product is evolving and changing and we watch the outside of Explore right now.
Hi John,
Thanks for your question! Unfortunately, at this time there is no way to import sources for Explore. There may be a feature like that in the future, but I don't have any specifics about when that feature will be built and made available.
Gentry G
Customer Advocate
Hi Devan - Community Manager
Was the issue with this "You need to have data for at least 2 cycles to forecast your result. Your current cycle length is 7." solved please? If yes could you tell me how as its happening for us too
Thanks
Hi Carl, I'd like to get one of the experts on the Explore team to take a look at this so I've opened a ticket. I'll add myself to the ticket so that I can make any necessary doc updates. Thanks!
I have a feedback about the forecasting. This year we had unexpected pikes in our ticket numbers due to pandemic. The forecast is building up on these numbers. However, we think it won't have the same trends at the same months or weeks next year.
Is there a possibility to indicate that and get more realistics forecasts?
Hi Gökhan Cicek
That's a really good question and I don't know the answer to that. I've created a ticket from your request so that one of the experts on the Explore team can take a look. If necessary, I'll make any required doc updates once they reply. Thanks for bringing this up!
hi rob, was this item on the covid19 resolved? as we are also making forecast now for dec. Appreciate any update. Thanks.
Hi IanChan thanks for the question and apologies for the slow update.
The resolution was that Explore and the forecasting model it uses does not have a way to explicitly exclude data from a forecast.
Our recommendation in this case is to wait for a certain amount of time (perhaps for a few weeks) and run the forecast model once the data is more normalized.
Keep in mind that you will be able to specify "values per cycle" (the # of data points for the model to compute) and use it as a way to mitigate any outliers (months/weeks where the volume is drastically higher than the rest).
I hope this helps a little. Thanks!
Hi Rob Stack, thanks for the update. I made initial forecast for annual, monthly and also weekly. So far the forecast numbers are ok - except for the covid spike months of march-april-may 2020 are affecting generally the succeeding month and week. The annual not much.
Any other tweaks we can do for the forecasting reports? new or secret recipes?
Thanks.
ian chan
Ezwadi Rosaidi just fyi
Hi IanChan, thanks for the response. No secret recipes I'm afraid, but your feedback does help us a lot as we plan for Explore's future. Thanks again!
ayt thanks rob!
Please sign in to leave a comment.