> 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` 字段中。
   * 将运算符类型更改为 **大于或等于**.
   * 回车 `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, 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/set-up-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.
