---
title: Recalculating
slug: how-tos/Rjw8-r
createdAt: 2025-11-13T13:18:21.483Z
---

Sometimes you might want to recalculate the data produced by a calculation, for example when the script used has been changed. This can be done using recalculations.

When selecting a calculation, you can see the `Recalculate` button on top of the details panel. This button will open the recalculate modal:

![](https://api.archbee.com/api/optimize/SMPo4IS9FkillUAMsur2c/OPvRNTpxjifdBFEhXslwF-20251113-154920.png)

Here, you have can choose between restarting the calculation in the past or recalculating a specific period. There's also the option to recalculate with a context specified.

## Restarting a calculation

When restarting a calculation, only a start time is specified. The calculation data will be recalculated starting from the given start time, after which the calculation will be enabled and running as usual.

## Recalculating a period

In contrast, recalculating a period takes both a start and an end time. This schedules a recalculation task that will regenerate the calculation data within the given time window, without changing the state of the calculation.

:::hint{type="info"}
Both methods will request the data from the time series database, meaning if the stored data has changed (e.g. if data was received very late), the results of the calculation might change as well.
:::

## Recalculating with context

A calculation has a stateful context that gets passed to each iteration. Recalculations support defining the initial context manually for more advanced configurations. By checking the `Recalculate with context`checkbox, you will see the context editor similar to the one below:

![](https://api.archbee.com/api/optimize/SMPo4IS9FkillUAMsur2c/E26lWFG84-7sbhDUkhvb1-20251113-154920.png)
