Skip to content

Commit

Permalink
Updated the function name from FORECAST to PREDICT
Browse files Browse the repository at this point in the history
  • Loading branch information
sujitnewrelic committed Jan 24, 2025
1 parent c862e5b commit bd00f65
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
74 changes: 37 additions & 37 deletions src/content/docs/nrql/nrql-syntax-clauses-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -462,43 +462,6 @@ As noted in our [basic NRQL syntax doc](/docs/query-your-data/nrql-new-relic-que
</Callout>
</Collapser>

<Collapser
className="freq-link"
id="#sel-prediction"
title={<><InlineCode>FORECAST</InlineCode> clause</>}
>
<Callout title="preview">
We're still working on this feature, but we'd love for you to try it out!

This feature is currently provided as part of a preview program pursuant to our [pre-release policies](/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy).
</Callout>

```sql
FROM NrAiIncidentDebug SELECT count(*) WHERE environment LIKE 'production'
TIMESERIES 1 hour FACET event SINCE 1 day ago FORECAST
...
```

With the FORECAST clause, you can incorporate predictions regarding future data trends into line and area charts based on historical data. This clause:

* Applies only to queries with a `TIMESERIES` clause.
* Uses the `TIMESERIES <time period>` as the interval for predicted data points.
* Sets the prediction range to 20% of the query window by default.
* Processes historical data from the current query window and the two preceding ones to generate predictions by default.

<Callout variant="important">
The `FORECAST` clause is not supported with the [`COMPARE WITH`](/docs/nrql/nrql-syntax-clauses-functions/#sel-compare) clause, [nested aggregations](/docs/nrql/using-nrql/nested-aggregation-make-ordered-computations-single-query), and inside [subqueries](/docs/nrql/using-nrql/subqueries-in-nrql/), or JSON functions.
</Callout>
You can additionally append `BY <time range>` and `USING <time range>` to refine the prediction trend to your specific needs.
To indicate the time range and historical data span, use `integer units`. For example:

```sql
FORECAST BY 1 hour USING 2 days
```

To learn more about how and when you can use `FORECAST`, see [NRQL predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions/).
</Collapser>

<Collapser
className="freq-link"
id="sel-join"
Expand Down Expand Up @@ -774,6 +737,43 @@ As noted in our [basic NRQL syntax doc](/docs/query-your-data/nrql-new-relic-que
</Callout>
</Collapser>

<Collapser
className="freq-link"
id="#sel-prediction"
title={<><InlineCode>PREDICT</InlineCode> clause</>}
>
<Callout title="preview">
We're still working on this feature, but we'd love for you to try it out!

This feature is currently provided as part of a preview program pursuant to our [pre-release policies](/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy).
</Callout>

```sql
FROM NrAiIncidentDebug SELECT count(*) WHERE environment LIKE 'production'
TIMESERIES 1 hour FACET event SINCE 1 day ago PREDICT
...
```

With the `PREDICT` clause, you can incorporate predictions regarding future data trends into line and area charts based on historical data. This clause:

* Applies only to queries with a `TIMESERIES` clause.
* Uses the `TIMESERIES <time period>` as the interval for predicted data points.
* Sets the prediction range to 20% of the query window by default.
* Processes historical data from the current query window and the two preceding ones to generate predictions by default.

<Callout variant="important">
The `PREDICT` clause is not supported with the [`COMPARE WITH`](/docs/nrql/nrql-syntax-clauses-functions/#sel-compare) clause, [nested aggregations](/docs/nrql/using-nrql/nested-aggregation-make-ordered-computations-single-query), and inside [subqueries](/docs/nrql/using-nrql/subqueries-in-nrql/), or JSON functions.
</Callout>
You can additionally append `BY <time range>` and `USING <time range>` to refine the prediction trend to your specific needs.
To indicate the time range and historical data span, use `integer units`. For example:

```sql
FORECAST BY 1 hour USING 2 days
```

To learn more about how and when you can use `PREDICT`, see [NRQL predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions/).
</Collapser>

<Collapser
className="freq-link"
id="show-event-types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To add prediction on a line or area chart, follow these steps:
To add prediction, select <DNT>**Predict trend**</DNT> from the <Icon name="fe-more-horizontal"/> menu.
The prediction trend appears on the chart, projecting future trends in **Data Explorer**. The prediction range is automatically set to 20% of the query window, and highlighted in gray. The graph appears in dotted lines within the forecast range.

The chart query populates with the `FORECAST` function. you can [refine the query](/docs/nrql/nrql-syntax-clauses-functions/#sel-prediction) according to your requirements and run it to get the updated trend.
The chart query populates with the `PREDICT` function. you can [refine the query](/docs/nrql/nrql-syntax-clauses-functions/#sel-prediction) according to your requirements and run it to get the updated trend.

</Step>

Expand All @@ -62,7 +62,7 @@ To add prediction on a line or area chart, follow these steps:
</Steps>

## Default prediction range [#default-prediction-range]
When you add a prediction on a chart, the `FORECAST` function is appended to the existing chart query. The following default behaviors are set:
When you add a prediction on a chart, the `PREDICT` function is appended to the existing chart query. The following default behaviors are set:
* **Prediction range**: Projects 20% of the total time specified in your query window, allowing you to see a short-term projection based on current trends.
* **Historical data**: Processes historical data from the current query window and the two preceding ones to generate predictions.
* **Time interval**: Matches the data point interval of the prediction on the query window, ensuring consistency in data projection.
Expand All @@ -71,7 +71,7 @@ Example:

```sql
FROM NrAiIncidentDebug SELECT count(*) WHERE environment LIKE 'production'
TIMESERIES 1 hour FACET event SINCE 1 day ago FORECAST
TIMESERIES 1 hour FACET event SINCE 1 day ago PREDICT
```
The default prediction on the chart appears as following:

Expand All @@ -98,7 +98,7 @@ Example:

```sql
FROM NrAiIncidentDebug SELECT count(*) WHERE environment LIKE 'production'
TIMESERIES 1 hour FACET event SINCE 1 day ago FORECAST BY 1 day USING 30 days
TIMESERIES 1 hour FACET event SINCE 1 day ago PREDICT BY 1 day USING 30 days
```

The refined prediction on the chart appears as following:
Expand Down

0 comments on commit bd00f65

Please sign in to comment.