> 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).

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

これがAdaloアプリで合計、カウント、平均、最小値、最大値を表示する方法です。

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

## 開始前に

* [データベース](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)することができます。

![](https://797861279-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4EFNSNZLMs5AZ70x2P33%2Fuploads%2Fgit-blob-e4dc94ea0059776c528238de9dd17048d9c7caed%2FGif%201%20Count%2C%20Sum%2C%20Ave.%20\(1\).gif?alt=media)

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

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

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

![](https://797861279-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4EFNSNZLMs5AZ70x2P33%2Fuploads%2Fgit-blob-ffd010d6066a25dad53728c743dc89d1b5a56d03%2FDemo%20-%20Edited%20\(2\).gif?alt=media)
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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