> 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. 从左侧导航菜单中，选择 ![](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. 可选地，应用一个 **跟踪窗口** 如果你想按滚动方式执行求和或计数计算。你的 impact.com 账户时区将适用于跟踪窗口。
   * ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FiZjM1xY8o3v1iR3Zaysd%2FToggle.svg?alt=media\&token=b1550d48-bba9-4e81-8604-bc12370c5caa) **\[开启]** 如果你只想将事件包含在计算中。有关窗口类型及其使用时机的详细信息，请参阅 [计算字段的跟踪窗口](/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. 选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-6282f271b7521383385339243690b303086736d9%2F3b5a585dd2895bdf1c30d1236c72ba590dddd18717863b27074c8d313d05ae20.svg?alt=media) **其他筛选条件** 如果你只想将符合特定条件的事件纳入计算。
   * 筛选条件可以应用于事件特征（例如，某次购买的收入金额）或用户特征（例如，统计参与者进行超过 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) 为所有参与者。
   * 选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FwXho9QKP3e4iU4ZKUSJ5%2F167ebb8cc30303.svg?alt=media\&token=a046e9f0-63aa-46f6-8a35-f73973fd326c) **\[复选框已勾选]** 如果你想回填计算结果。
9. 选择 **保存** 以保存你的更改。

#### 示例

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

<details>

<summary>设置说明</summary>

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

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

   * 选择 **添加规则**.
   * 对于第一个条件 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-c2cb550b55c51ea1eeff0acbd6f437a03b621a2c%2F60d033ae8a04c14498d5229c3c0160ac05feea7f605dbd770741793c900469f0.svg?alt=media) **\[下拉菜单]**，选择 `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 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/set-up-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.
