PREDICT <Aggregation_Function>(<target_table>.<column_name>, <start>, <end>) <comparison_operator> <constant>
(Required)SUM
AVG
MAX
MIN
COUNT
COUNT_DISTINCT
LIST_DISTINCT
LAST
FIRST
LIST_DISTINCT
for a smooth user experience we only recommend using it if the number of possible values to return is less than 1000.
Within the aggregation function inputs, the start
and end
parameters refer to the time period you want to aggregate facts across, as calculated in days. For example: 10
for start
and 30
for end
implies that you want to aggregate across all facts from 10 days later (excluding the 10th day) to 30 days later (including the 30th day). Both start
and end
should be non-negative integers and end
should be strictly greater than start
.
In general for the target formula, you should input a facts table that has historic fact data over a timeframe that is at least an order of magnitude more than the prediction horizon in your target formula. For example, if you are predicting over the next 30 days, especially to take into account seasonality, you’d probably be best off including at least 1 year of rows in your fact table.
Note it is also optionally possible to convert your prediction target into a conditional statement prediction problem (e.g. a prediction of whether a particular target expression is true or false) by adding a comparison operator.
>
<
=
!=
>=
<=
STARTS WITH
ENDS WITH
CONTAINS