# Using previous values of a metric

One of the most exciting features metrics provide you is the opportunity to compare the current value of the metric with some values of it within a certain period:

* Metric average
* Metric quantile
* Metric median

Examples:

<figure><img src="/files/F6OcKBvWshdJvbLQv2wX" alt=""><figcaption><p>Metric average value</p></figcaption></figure>

<figure><img src="/files/1gbHJZqkQfC9wnPDSsBG" alt=""><figcaption><p>Metric quantile</p></figcaption></figure>

More information about these functions can be found on [Mathematical functions](/pipelines/mathematical-functions.md).

{% hint style="info" %}
These functions only use the values of this metric from the moment it was created and first run. For example, if you created and scheduled this metric on February 25th and want to calculate an average value, it won't consider the values before that date.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ylem.co/metrics/using-the-average-value-of-a-metric.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
