> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/edit-a-calculated-field.md).

# 编辑计算字段

计算字段值可用于设置您的程序规则，从而实现各种高级程序逻辑。用户创建的 [计算字段](/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/calculated-fields-explained.md) 可随时编辑。

#### 编辑计算字段

1. 从左侧导航菜单中，选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-230534471fef5f40808e921e41ee44e4a06ded03%2Fe6cb9548999afdc1ed3ce4942e4cb5b45b5cecbd323267aac2a7cd1915fccc09.svg?alt=media) **\[Engage] → 数据源 → 字段**.
2. 将光标悬停在要编辑的字段上，然后选择 **编辑**.
   * 您必须选择一个用户创建的计算字段。默认计算字段无法编辑。
3. 根据需要编辑字段。
   * 您可以更改用于计算字段的事件以及任何筛选条件或跟踪窗口。
   * 计算字段键和计算类型无法更改。
4. 可选地，在 *审核* 部分下，选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-b5e1740618ed6571d97b8fed7c25a7678f85d375%2F299632fb6f4f91fbf9847471754cc6180e4284a65b4960af4c4ea472a159f552.svg?alt=media) **\[未勾选的复选框] 保存时重新计算值**.
   * 如果您的字段使用 `求和` 或 `计数` 计算，那么我们建议请求 [重新计算](/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields.md)。对于其他计算类型，无法重新计算——请参阅 [重新计算注意事项](#edit-a-calculated-field) 后再进行更改。
5. 选择 **保存**.

#### 重新计算注意事项

| 如果                           | 然后                                                                                              | 示例                                                                                                                                                                   |
| ---------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 该字段没有跟踪窗口，或者跟踪窗口已被 **移除**.   | <p>• 将保留之前的字段值，并作为新计算的起点。</p><p>• 新计算将用于后续。</p>                                                 | 该字段当前对以下事件的收入进行求和： `userPurchase` 事件。当您将其更新为对以下事件的收入求和时： `purchase` 事件时，参与者资料中的现有值将保持不变。下次我们收到他们的 purchase 事件时，收入金额将添加到现有值中。                                         |
| 该字段已有一个跟踪窗口，但该窗口 **未更改**.    |                                                                                                 |                                                                                                                                                                      |
| 正在将跟踪窗口 **添加到** 现有计算字段       | <p>• 之前的字段值仅会保留到新事件到来为止。下一个匹配事件到来时，它将被清除。</p><p>• 新配置将用于后续。</p><p>• 如果您想让新配置考虑历史数据，请请求重新计算。</p> | <p>该字段统计参与者的购买次数。如果您添加一个一个月的跟踪窗口，当下一个 purchase 事件到来时，参与者资料中的现有值将被清除。</p><p>一位进行了 5 次购买的参与者，其值将为 <code>5</code> 在您编辑之前。下次该参与者进行购买时，旧值将被清除，字段值将设置为 <code>1</code>.</p> |
| 该字段已有一个正在被 **编辑的**.          | <p>• 在编辑计算字段上的现有窗口时，请务必重新计算。</p><p>• 不重新计算就进行编辑可能会对参与者的字段值产生不利影响。</p>                           | 您将跟踪窗口从固定窗口更改为滑动窗口。                                                                                                                                                  |
| 该字段已有一个滑动窗口，并且 **最大计算值已更改**. | <p>• 当下一个匹配事件到来时，新配置将应用于参与者的历史数据。</p><p>• 请求重新计算，可在无需等待新事件的情况下更新字段值。</p>                        | 该窗口字段当前统计参与者已进行的购买次数，最大值为 10。当最大值更改为 5 且该参与者的新 purchase 事件到来时，窗口内的数据将追溯应用 5 的上限。                                                                                     |

{% hint style="warning" %}
**警告：** 无法通过 API 手动覆盖窗口计算字段的值。如果您发送的数据会覆盖现有值，您将收到错误消息。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/edit-a-calculated-field.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
