> 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/set-up-a-calculated-field.md).

# 设置计算字段

**有限制**：计算自定义字段仅适用于某些产品版本。 [联系支持](https://app.impact.com/support/portal.ihtml?createTicket=true&) 以升级您的倡导者计划并获得访问权限。

计算字段可让你在事件到达时对其进行跟踪，使用事件字段设置计算，并将结果数据存储在参与者的个人资料上。一旦设置好计算字段，其值就会随着你发送符合条件的 impact.com 事件而动态更新。

本指南将向你展示设置计算字段的基本流程，包括最后的示例。有关计算字段如何工作以及可进行哪些类型的计算的更多详情，请参阅 [计算字段说明](/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. 可选地，从 **跟踪窗口** 如果你想按滚动方式执行求和或计数计算。你的 impact.com 账户时区将适用于跟踪窗口。
   * ![](/files/3980f01ba7b178cc917bfb7b270feb4fac2992c6) **\[打开切换]** 如果你想仅在计算中包含事件。有关窗口类型及其使用时机的详情，请参阅 [计算字段的跟踪窗口](/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/tracking-windows-for-calculated-fields-explained.md)
5. 如果你应用了滑动窗口，则可以为间隔中的每个单位设置要计入的最大值（例如，60 天间隔中的每一天）。
6. 在 *筛选器* 字段，添加一个 **活动周期** 如果你想为计算设置开始日期和结束日期。
7. 选择 ![](/files/a4d92afe6e302635e52a9d3b155bca7a8dedb2ea) **额外筛选条件** 如果你只想将符合特定条件的事件纳入计算。
   * 筛选器可以应用于事件特征（例如，某次购买的收入金额）或用户特征（例如，参与者进行一次超过 100 美元购买的次数统计）
8. **审核** 你的选择，并决定是否要 [回填这些值](/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/edit-a-calculated-field.md) 适用于所有参与者。
   * 选择 ![](/files/d4151d93ed2da7b33e79d07ae02bdd88dbd67390) **\[已勾选的复选框]** 如果你想回填计算结果。
9. 选择 **保存** 以便保存你的更改。

#### 示例

* 你有一个推荐计划，并希望奖励那些在被推荐后不久频繁进行大额购买的参与者。你确定，对于你的计划而言，这意味着在推荐开始后的一个月内，任何进行了 3 次或以上、且每次至少 50 美元购买的参与者。计算字段可以帮助你确定哪些参与者达到这一门槛，并可作为向这些参与者发放奖励的计划规则基础。

<details>

<summary>设置说明</summary>

以下是设置该计算的方法：

1. 在 **计算**，完成 **名称** 字段中。
2. 为事件和计算字段输入以下值：
   * **事件**：购买
   * **计算**：计数
     * 这将把计算设置为统计 impact.com 接收到的、符合你条件的购买事件出现了多少次。
3. 应用固定 **跟踪窗口**。这将使计算每个月重置一次。
   * 选择 **固定窗口**.
   * 选择一个 **1 个日历月** 窗口时长。
4. 添加 **筛选器** 以指定你只想统计金额为 50 美元或以上的购买事件：

   * 选择 **添加规则**.
   * 对于第一个条件 ![](/files/9ee7bd3c79aae4d0667377d18611647c3469f8d1) **\[下拉菜单]**，请选择 `events.fields.revenue` 字段中。
   * 将运算符类型更改为 **大于或等于**.
   * Enter `50` 作为字符串变量值。

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>注意：</strong> JSONata 表达式只接受整数。使用货币时，impact.com 建议使用数据库配置中所使用的最小货币单位。如果你不确定， <a href="http://saasquatch-support@impact.com">请联系我们的支持团队</a> 寻求帮助。</p></div>
5. 审查并 **保存**.

</details>


---

# 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:

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

The question should be specific, self-contained, and written in natural language.
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.
