# Compute evolution

This Compute evolution steps allows you to calculate the change in values over time, both in absolute terms and as a percentage. It's particularly useful for tracking trends and growth rates in your data.

### Step parameters

* `Date column` **column(string)\***: the date column (must be of type `date`) that will be used as a reference for the computation
* `Value column` **column(string)\***: the value column that you want to compute the evolution of
* `Compute evolution vs` **string\["last year", "last month", "last week", "last day"]\***: whether you want to compute evolution versus last year, last month, last week or last day
* `Compute evolution in` **string\["absolute value", "percentage"]column(string)\***: Choose `absolute value` for absolute difference or `percentage` for percentage change.
* `Group by`(optional) **column(array)**: Use this option if you need to perform the evolution computation by group of rows. You should do so to make sure every date is unique inside each and every group. See examples 2 and 3 for a concrete illustration.
* `New column name` **string (optional)**: Use this option if you want to give a custom name to the output column. By default, it will be your original column name suffixed with either `_EVOL_ABS` or `_EVOL_PCT` depending on the kind of evolution that you chose.

### Example

**Input**

<figure><img src="/files/Ujii4djLvgF8vEr7UOlV" alt=""><figcaption><p>Compute - Compute evolution input</p></figcaption></figure>

**Configuration**

```json
{
    "date_col": "date",
    "value_col": "sales",
    "evolution_type": "last year",
    "evolution_format": "abs", 
    "index_columns": ["region", "product"]
    "new_column_name": ""
}
```

**Output**

<figure><img src="/files/RESIESKOJOSGu1AqGZNY" alt=""><figcaption><p>Compute - Compute evolution output</p></figcaption></figure>


---

# 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-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/overview-of-youprep-tm/compute/compute-evolution.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.
