Predict Seasonal Data with New SAQL Timeseries Options

SAQL timeseries makes the most accurate predictions possible based on your existing data. It selects the best algorithm for the data you have, even if your data has seasonal variation. timeseries now supports daily and weekly seasonality as well as monthly, quarterly, and yearly seasonality. Does your case load have a weekly variation with call volume peaking near the end of the week? No problem - use timeseries to predict call volumes so you can plan.

Where: This feature is available in Einstein Analytics in Lightning Experience and Salesforce Classic. Einstein Analytics is available in Developer Edition and for an extra cost in Enterprise, Performance, and Unlimited editions.

Who: To use SAQL, you must have an Analytics Platform license.

Why: You can now specify any seasonality period between 2 and 24. Do your manufacturing sales have a 10-month seasonality? Or do your opportunities for certain products peak every three years? Use timeseries to accurately predict the value of future data, no matter what the seasonal pattern.

How: To use timeseries, open up your SAQL editor in the dashboard. Use foreach to project the data you want to look at, then use timeseries to make the prediction for your chosen measure.

For example, you want to predict the number of calls your support team will get in the next 30 days. You know that call volume has a weekly seasonality, so you set dateCols=('time_Year','time_Month','time_Day',"Y-M-D"). Set length=30, because we want the prediction for 30 days. Set ignoreLast=true, because we are only halfway through the current week (ignoring partial time periods improves the prediction's accuracy).

q = load "CaseData";
-- get the data from the past 90 days
q = filter q by date('time_Year', 'time_Month', 'time_Day') in ["90 days ago".."current day"];
q = group q by ('time_Year', 'time_Month', 'time_Day');
q = foreach q generate 'time_Year' , 'time_Month', 'time_Day', count() as 'count';

-- use fill to fill any missing days. 
q = fill q by (dateCols=('time_Year','time_Month','time_Day',"Y-M-D"));

-- predict the number of calls for the next 30 days
q = timeseries q generate 'count' as 'predicted_count' with (dateCols=('time_Year','time_Month','time_Day',"Y-M-D"), length=30, ignoreLast=true);
q = foreach q generate 'time_Year' + "~~~" + 'time_Month' + "~~~" + 'time_Day' as 'time_Year~~~time_Month~~~time_Day', 'predicted_count';
q = order q by 'time_Year~~~time_Month~~~time_Day' asc;
q = limit q 1000;

The predicted call volume for the next 30 days has weeky variability:

The predicted number of calls