# 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="https://1809014303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZxYYf1KpgarKMgMsDCrw%2Fuploads%2Fgit-blob-e7a4dd07dfcb4681d149e54007db9660272774e5%2Fevolution_input.png?alt=media" 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="https://1809014303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZxYYf1KpgarKMgMsDCrw%2Fuploads%2Fgit-blob-7e4ac31b172866d5e4ada05ecb17c73f23dcf73d%2Fevolution_results.png?alt=media" alt=""><figcaption><p>Compute - Compute evolution output</p></figcaption></figure>
