> 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/calculated-fields-explained.md).

# 計算フィールドの解説

**制限あり**: 計算済みのカスタムフィールドは、特定の製品エディションでのみ利用できます。 [サポートにお問い合わせください](https://app.impact.com/support/portal.ihtml?createTicket=true&) アクセスを得るには、Advocateプログラムをアップグレードしてください。

〜を通じて [カスタムフィールド](/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/custom-fields-for-advocate-explained.md)、リファラルプログラムの運用に必要な基本情報に加えて、Advocate参加者に関する幅広い追加情報をimpact.comに送信できます。

計算フィールドはユーザーおよびイベントのデータを受け取り、その値は計算・保存され、参加者のプロフィールに表示されるようになります。計算フィールドを設定すると、条件に合うAdvocateプログラムのイベントを送信するたびに、その値が動的に更新されます。

{% hint style="info" %}
**例：** 計算フィールドは、1か月の期間内に参加者が100ドル以上の購入を何回行ったかをカウントするように設定できます。さらに、1か月にこの100ドル以上の購入を少なくとも3回行った参加者に特別な報酬を付与するよう、プログラムを設定できます。
{% endhint %}

#### 既定の計算フィールド

既定で、4つの計算フィールドが用意されています。プログラムのルール設定を始めたらすぐに、これらを参照できます。

<details>

<summary>既定の計算フィールド</summary>

| 計算フィールド            | 説明                                  |
| ------------------ | ----------------------------------- |
| lastSeenDate       | ユーザーがAdvocateで最後にupsertされた日時を追跡します。 |
| firstPurchaseDate  | この参加者について購入イベントを受信した最初の日付を追跡します。    |
| lastPurchaseDate   | 参加者の最新の購入イベントの日付を追跡します。             |
| totalPurchaseCount | この参加者の購入イベントの総数を追跡します。              |

</details>

#### クライアント作成の計算フィールド

提供される既定のものを超える独自の計算フィールドを作成できます。計算フィールドを設定すると、次のことができます：

* 計算を限定期間だけ実行したい場合は、開始日と終了日を追加します（例：1月1日から2月17日まで）。この設定された期間はアクティブ期間と呼ばれます。
* 定期的な [集計期間](/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) 合計および件数の計算用に。トラッキングウィンドウは、固定ウィンドウ（例：単一の暦月または年）またはスライディングウィンドウ（例：過去90日間）のいずれかにできます。
* フィルターを追加したりJSONata式を記述したりして、計算を実行する条件に追加の制約を設定できます。これらのオプションについては、記事でより詳しく説明しています [計算フィールドの設定](/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/set-up-a-calculated-field.md).

{% hint style="info" %}
**注：** 計算フィールドにアクティブ期間またはトラッキングウィンドウがある場合、計算期間が終了すると値は更新されなくなります。計算フィールドにアクティブ期間（または、合計/件数の計算に限りトラッキングウィンドウ）がある場合も、計算期間終了後は値はそれ以上更新されません。ただし、値は各参加者のプロフィールに引き続き表示されます。
{% endhint %}

<details>

<summary>クライアント作成の計算フィールド</summary>

計算フィールドを作成する際に使用できる計算には、いくつかの種類があります。

| 計算       | 説明                                                  | 例                                                                  |
| -------- | --------------------------------------------------- | ------------------------------------------------------------------ |
| 合計       | 〜の合計を計算する `{fieldname}` 〜のフィールドから `{eventkey}` イベント | 紹介された友人が登録後最初の30日間に行った購入をすべて合計します。使った金額に応じて、顧客アドボケイトに段階的な報酬を付与します。 |
| カウント     | 〜の数をカウントする `{eventkey}` イベント                        | 参加者が10回を超える購入を行ったら報酬を付与します。                                        |
| 初回確認（日時） | 最初の〜のタイムスタンプを計算する `{eventkey}` イベント                 | ある日付より前に購入を始めた参加者に報酬を付与します。                                        |
| 最終確認（日時） | 最後の〜のタイムスタンプを計算する `{eventkey}` イベント                 | 最後の購入が5日以内だった参加者に報酬を付与します。                                         |
| 最初の値     | 〜の値を計算する `{fieldname}` 最初の{eventkey}イベントのフィールド      | 初回の大口購入を行った参加者に報酬を付与します。                                           |
| 最後の値     | 〜の値を計算する `{fieldname}` 最新の〜のフィールド `{eventkey}` イベント | 最後の支払い額が一定額以上だった参加者に報酬を付与します。                                      |

</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/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/calculated-fields-explained.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.
