> For the complete documentation index, see [llms.txt](https://help.adalo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.adalo.com/ja/component-basics/inserting-dynamic-text/connecting-your-database-for-counts-and-aggregating.md).

# 合計、カウント、平均、最小値と最大値

*スキルレベル: 中級から上級*

## 開始前に

* [データベース](https://help.adalo.com/database)の知識が必要です

## 手順

{% tabs %}
{% tab title="詳細" %}
データベース内に関連付けられた2つのコレクションがある場合、マジックテキストを使用して合計、カウント、平均、最小値、最大値を表示することができます。

例えば、TripsというデータベースコレクションとActivitiesという別のコレクションがあり、各Activityには価格プロパティがある場合、各Tripに複数のActivitiesがある場合、Tripに関する情報を表示する画面やリストがある場合、マジックテキストを使用して以下を表示できます：

* そのTripのActivitiesのカウント
* そのTripのActivitiesの価格の合計
* そのTripのActivitiesの平均価格
* そのTripのActivitiesの最高価格
* そのTripのActivitiesの最低価格

どんな数値でも、アプリ内で表示される際に[数値のフォーマットをカスタマイズ](/ja/component-basics/inserting-dynamic-text/how-to-format-dates-and-numbers.md)することができます。

![](/files/xQnvP1uvhKFFdEgt4WPp)

#### フィルターの追加

これらの集計に含めるレコードを指定するためにフィルターを追加することもできます。例えば、Activitiesコレクションに"Will Definitely Do"というTrue/Falseプロパティがある場合、"Will Definitely Do"がTrueに等しいActivitiesの価格の合計のみを表示するようにフィルターを追加できます。

フィルターを追加するには、単にチップをクリックして、Add Filterを選択します。

![](/files/VxOUODRIpD6qK2JLkta0)
{% endtab %}
{% endtabs %}

## ヘルプ

この記事に関する追加のヘルプが必要な場合は、いつでも[コミュニティフォーラム](https://forum.adalo.com/)で質問できます！投稿にこの記事へのリンクを貼り付けることも忘れずに！


---

# 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.adalo.com/ja/component-basics/inserting-dynamic-text/connecting-your-database-for-counts-and-aggregating.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.
