# Aggregates

At Marple we believe that often one graph tells a better story than thousand data points. Yet sometimes the truth is really in a single number.

Marple caters to this by making it possible to add aggregates to your project.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2F9FExGgwEiFwdQpBQdDAA%2FScreenshot%202025-01-28%20at%2011.49.39.png?alt=media&#x26;token=b07ebdd2-2d37-4a94-b567-d13647391e14" alt="" width="563"><figcaption></figcaption></figure>

There are three formats in which you can add aggregates to your project.

* **Table format**, useful to show a bunch of data along two variables;
* **Number format**, useful to show a single number;
* **Bar format**, similar to the table format but more visual.

## Get started

When you click on **Add Plot,** select the aggregate format you would like to add.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FW27MSuUjERRMiJih7mNN%2FScreenshot%202025-01-28%20at%2011.40.31.png?alt=media&#x26;token=f1b95f6f-8dbc-4f93-951b-4ded93653ea5" alt="" width="207"><figcaption></figcaption></figure>

## Edit aggregate

Whichever aggregate format you chose, to edit the calculation of the aggregate, click on the settings wheel in the top right of the plot.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FoY53kMDgVL016Utiyv6E%2Fimage.png?alt=media&#x26;token=df8b9712-af96-4763-9675-5e62e15ce183" alt=""><figcaption></figcaption></figure>

This is where you can edit how your aggregate is calculated.

## Aggregate Method

In the edit screen, you can select the method with which to calculate the aggregate.

Currently, the following aggregation methods are available:

* Average
* Minimum
* Maximum
* Sum
* Count

## Filter

In the filter section, you can define the conditions on which you want the metric to be calculated.

Setting a filter is optional. If you define multiple filters, they all need to be true. So filter1 AND filter2 have to be TRUE for a data point to be included in the aggregate.&#x20;

## Group by

In case you would like the aggregate to be a table or a bar chart, you should select a signal by which to group the calculation.

To add a signal, simply drag and drop a signal from the Signal List.

There are two ways of grouping the data:

* **Unique:** Create a group for each unique value in the signal. This is great for discrete signals or text signals.
* **Bins:** manually define the **bin range**, this defines the range of the signal's Y-axes values that should be included, and the **bin size.** This is the unit by which the range will be divided. This is useful when you have a continuous signal.

Consider the following example:

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FfT9bbQYCC5MMGZk9h3W8%2Fimage.png?alt=media&#x26;token=c524fd56-43e9-4319-9826-9fd919a5618f" alt=""><figcaption></figcaption></figure>

If the aggregate format is a bar chart, and the aggregate is the average of the engine temperature or `avg(m.engine.temperature)`, you will have the following bar chart.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FHKp4D3CYuW1uimus6IEF%2Fimage.png?alt=media&#x26;token=aec60663-568f-40b3-a994-892dd9c30bfd" alt=""><figcaption><p>Distribution of the average engine temperature per lap</p></figcaption></figure>

If you want to see the average engine temperature depending on the engine rate, you can use the engine rate signal to group and set the bin limits and width like this&#x20;

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2Fb3BxV7p3kwwZ5GznzO5p%2Fimage.png?alt=media&#x26;token=8bf9d7b2-637c-4f5d-9d2a-eebb4a0e6d6e" alt=""><figcaption></figcaption></figure>

To get the following bar chart.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FnDD5BIqqowxlwjre8JM4%2Fimage.png?alt=media&#x26;token=135c5f46-44a2-4346-ad3b-f17331714358" alt=""><figcaption></figcaption></figure>

You can also resample the different input signals, so that you can use signals together with different time bases. See [resampling](https://docs.marpledata.com/docs/marple-insight/user-manuals/visualisation/resampling "mention") for more details.

## Bar settings

Finally, if you chose a bar chart to visualise your aggregate, you can also set the width of the bars as a share of the available space it should take.

## Text data

You can use text data to group in bar charts and tables, the values are used as labels in the plot:

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2F9o1zfuAhLbknVu3cssiC%2Fimage.png?alt=media&#x26;token=d828887c-0847-4435-94c7-25ae0040bfef" alt=""><figcaption><p>Text signal used to group in table</p></figcaption></figure>

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FhFRbELSEczjqRoeNxyXc%2Fimage.png?alt=media&#x26;token=9a7c140d-99af-4dbb-905a-a054aeccfe32" alt=""><figcaption><p>Text signal used to group in bar chart</p></figcaption></figure>

## Discover Aggregates in 1 minute

{% embed url="<https://www.youtube.com/watch?index=40&list=PLtVuqpI9QpJAFtUEvuS23Z47XGHrRc_P9&v=5bbVTsnIeMw>" %}

Want to discover more Marple features in 1 minute? Check out other [1-minute-marple-videos](https://docs.marpledata.com/docs/other-resources/1-minute-marple-videos "mention")
