# Edit a Calculated Field

Calculated field values can be used in setting up your program rules, allowing for a wide range of advanced program logic. User-created [calculated fields](https://help.impact.com/brand/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/calculated-fields-explained) can be edited at any time.

#### Edit a calculated field

1. From the left navigation menu, select ![](https://4048883401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-230534471fef5f40808e921e41ee44e4a06ded03%2Fe6cb9548999afdc1ed3ce4942e4cb5b45b5cecbd323267aac2a7cd1915fccc09.svg?alt=media) **\[Engage] → Data Sources → Fields**.
2. Hover your cursor over the field you want to edit, then select **Edit**.
   * You must select a user-created calculated field. The default calculated fields cannot be edited.
3. Edit the field as required.
   * You can change the event used to calculate the field and any filters or tracking windows.
   * The calculated field key and calculation type cannot be changed.
4. Optionally, within the *Review* section, select ![](https://4048883401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-b5e1740618ed6571d97b8fed7c25a7678f85d375%2F299632fb6f4f91fbf9847471754cc6180e4284a65b4960af4c4ea472a159f552.svg?alt=media) **\[Unchecked box] Recalculate values on save**.
   * If your field uses a `sum` or `count` calculation, then we recommend requesting a [recalculation](https://help.impact.com/brand/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields). For other calculation types, recalculation isn't possible—refer to the [recalculation considerations](#section-idm234428141470463) before making changes.
5. Select **Save**.

#### Recalculation considerations

| If                                                                                          | Then                                                                                                                                                                                                                                                                                                              | Example                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The field does not have a tracking window or the tracking window has been **removed**.      | <p>• The previous field value will be retained and act as the starting point for the new calculation.</p><p>• The new calculation will be used moving forward.</p>                                                                                                                                                | The field currently sums the revenue on `userPurchase` events. When you update it to sum revenue on `purchase` events instead, the existing value on a participant’s profile will be unchanged. The next time we receive a purchase event for them, the revenue amount is added to the existing value.                                                                                                                                  |
| The field has an existing tracking window but the window is  **unchanged**.                 |                                                                                                                                                                                                                                                                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| A tracking window is being **added to** an existing calculated field                        | <p>• The previous field value will be retained only until new events come in. It will be wiped when the next matching event comes in.</p><p>• The new configuration will be used moving forward.</p><p>• Request a recalculation if you want to take historical data into account with the new configuration.</p> | <p>The field counts the number of purchases a participant makes. If you add a tracking window for a month, the existing value on the participant’s profile is wiped when the next purchase event comes in.</p><p>A participant who made 5 purchases would have a value of <code>5</code> prior to your edits. The next time this participant makes a purchase, the old value is wiped and the field value is set to <code>1</code>.</p> |
| The field has an existing tracking window that is being  **edited**.                        | <p>• When editing an existing window on a calculation field, be sure to recalculate.</p><p>• Editing without recalculation can have adverse effects on the participant's field value.</p>                                                                                                                         | You change your tracking window from a fixed window to a sliding window.                                                                                                                                                                                                                                                                                                                                                                |
| The field has an existing sliding window and the  **maximum calculation value is changed**. | <p>• The new configuration will be applied to participants’ historical data when the next matching event comes in.</p><p>• Request a recalculation to update the field value without waiting for new events.</p>                                                                                                  | The windowed field currently counts the number of purchases a participant has made, to a maximum value of 10. When the max changes to 5 and a new purchase event comes in for that participant, the maximum of 5 will be retroactively applied to the data within the window.                                                                                                                                                           |

{% hint style="warning" %}
**Warning:** The value of a windowed calculated field can’t be manually overwritten via API. You will receive an error message if you send us data that would overwrite an existing value.
{% endhint %}
