> 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. 在左侧导航菜单中，选择 ![](/files/209022bdb234289211a24a980f6227a8684cc439) **\[Engage] → 数据源 → 字段**.
2. 将鼠标悬停在要编辑的字段上，然后选择 **编辑**.
   * 您必须选择用户创建的计算字段。默认计算字段无法编辑。
3. 按需要编辑字段。
   * 您可以更改用于计算该字段的事件，以及任何筛选条件或跟踪窗口。
   * 计算字段键和计算类型无法更改。
4. 此外，在 *审核* 部分，选择 ![](/files/48509e0f0c9ae68203294f8aae7777211a4315e1) **\[未勾选的复选框] 保存时重新计算数值**.
   * 如果您的字段使用 `求和` 或 `计数` 计算，则我们建议请求 [重新计算](/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>该字段会统计参与者进行的购买次数。如果您为其添加一个一个月的跟踪窗口，则在下一次购买事件到来时，参与者资料上的现有值将被清除。</p><p>在您编辑之前，完成 5 次购买的参与者的值将为 <code>5</code> 。下次该参与者进行购买时，旧值将被清除，字段值将设为 <code>1</code>.</p> |
| 该字段已有一个跟踪窗口，正在被 **编辑**.     | <p>• 编辑计算字段上的现有窗口时，请务必重新计算。</p><p>• 不重新计算就编辑，可能会对参与者的字段值产生不利影响。</p>                                 | 您将跟踪窗口从固定窗口更改为滑动窗口。                                                                                                                                            |
| 该字段已有一个滑动窗口，而 **最大计算值已更改**. | <p>• 新配置将在下一次匹配事件到来时应用于参与者的历史数据。</p><p>• 请求重新计算，无需等待新事件即可更新字段值。</p>                                 | 该带窗口的字段目前会统计参与者的购买次数，最大值为 10。当最大值变为 5，并且该参与者又收到一次新的购买事件时，窗口内的数据将追溯应用 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.
