> 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/ja/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イベントを送信するたびに、その値が動的に更新されます。

このガイドでは、最後に例を示しながら、計算フィールドを設定する基本的な手順を説明します。計算フィールドの仕組みや実行できる計算の種類について詳しくは、 [計算フィールドの解説](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/calculated-fields-explained.md).

#### 計算フィールドを設定する

1. 左側のナビゲーションメニューから、 ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-230534471fef5f40808e921e41ee44e4a06ded03%2Fe6cb9548999afdc1ed3ce4942e4cb5b45b5cecbd323267aac2a7cd1915fccc09.svg?alt=media) **\[Engage] → Data Sources → Fields**.
2. 選択します **計算フィールドを作成**.
3. 各項目に入力します：
   * **名前**
   * **イベント**
   * **計算**
   * **イベントフィールド** （計算に該当する場合）
4. 必要に応じて、 **トラッキング期間** を適用すると、一定期間ごとに合計または件数を計算できます。トラッキング期間には、impact.comアカウントのタイムゾーンが適用されます。
   * ![](https://1458456015-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) **\[オンに切り替え]** を選択すると、計算に含めるイベントを期間内のものだけに限定できます。期間の種類と使い分けについては、 [計算フィールドのトラッキング期間](https://help.impact.com/brand/ja/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://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-6282f271b7521383385339243690b303086736d9%2F3b5a585dd2895bdf1c30d1236c72ba590dddd18717863b27074c8d313d05ae20.svg?alt=media) **追加フィルター** を選ぶと、特定の条件を満たすイベントだけを計算に含めることができます。
   * フィルターはイベントの特性（例：特定の購入における収益額）にも、ユーザーの特性（例：参加者が100ドルを超える購入をした回数）にも適用できます。
8. **確認** 選択内容を確認し、すべての参加者について値を [遡及計算する](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/edit-a-calculated-field.md) かどうかを決めます。
   * 計算を遡及して実行する場合は、 ![](https://1458456015-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. 選択します **保存** すると、変更が保存されます。

#### 例

* 紹介プログラムを運営しており、紹介後すぐに高額な買い物を頻繁にする参加者に報酬を提供したいとします。プログラムでは、紹介開始後の1か月間に50ドル以上の購入を3回以上行った参加者を対象とすることにしました。計算フィールドを使えば、この基準を満たす参加者を特定し、その参加者に報酬を付与するプログラムルールの条件として利用できます。

<details>

<summary>設定手順</summary>

計算は次のように設定できます：

1. 「 **計算**」セクションで、 **名前** フィールド。
2. イベントと計算の各フィールドに、次の値を入力します。
   * **イベント**：購入
   * **計算**：カウント
     * これにより、指定した条件を満たす購入イベントをimpact.comが受信した回数をカウントする計算が設定されます。
3. 固定の **トラッキング期間**を適用します。これにより、計算は毎月リセットされます。
   * 選択 **固定期間**.
   * 期間を **暦月1か月** に設定します。
4. 追加 **フィルター** を設定し、50ドル以上の購入イベントのみをカウントするよう指定します。

   * 選択 **ルールを追加**.
   * 最初の条件では ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-c2cb550b55c51ea1eeff0acbd6f437a03b621a2c%2F60d033ae8a04c14498d5229c3c0160ac05feea7f605dbd770741793c900469f0.svg?alt=media) **\[ドロップダウンメニュー]**&#x304B;ら `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/ja/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.
