> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
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=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
