# Aggregated View

### Overview

Aggregated View allows you to store aggregated data separately from raw time series storage. This feature helps you generate structured datasets by applying predefined aggregation methods to selected data points.

### Core Features

* **Enterprise Plan Exclusive** – Requires activation under **Organization Settings > Add-ons**.
* **Dedicated Storage for Aggregated Data** – Allows you to store processed data separately from raw device data.
* **Predefined Aggregation Methods** – Allows you to apply **Minimum, Maximum, Summation, and Average** to selected data points.
* **Customizable Data Points** – Allows you to select specific data fields (e.g., temperature, pressure) for aggregation.
* **Seamless Dashboard Integration** – Allows you to use Aggregated Views as a data source for widgets.
* **Optimized Querying** – Allows you to retrieve structured and pre-processed data efficiently.

### Enabling Aggregated View (Add-on Activation)

{% hint style="info" %}
Aggregated View is an **Enterprise plan exclusive** feature and must be **enabled as an Add-on** under **Organization Settings > Add-ons** before use.
{% endhint %}

Before using Aggregated Views, you need to enable the Add-on:

1. Navigate to **Organization Settings > Add-ons**.
2. Locate **Aggregated View** and click **Enable**.

{% hint style="success" %}
Once activated, Aggregated Views can be created under the **Analytics** tab on the **Device Detail** page.
{% endhint %}

### Creating an Aggregated View

After activation, Aggregated Views can be created under the **Analytics** tab for any device that your account has access to.

<figure><img src="https://3109056034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQfo4zX1x0hfOimS9E2u%2Fuploads%2F1HZ5R1rAQ8wXmvBidyRb%2FCleanShot%202025-03-03%20at%2022.16.06%402x.png?alt=media&#x26;token=558d9d72-722b-42e2-aa6f-a9301dc1f7e6" alt="" width="563"><figcaption></figcaption></figure>

1. Go to the **Device Detail** page.
2. Navigate to the **Analytics** tab.
3. Click **Create, then Aggregated View** and provide:
   * **Name** (e.g., "Daily Energy Consumption")
   * **Description** (optional)
   * **Data Points** (choose specific fields such as temperature, humidity)
   * **Aggregation Methods** (select from **Minimum, Maximum, Summation, and Average**)
   * **Retention Period** (define how long aggregated data should be stored)
4. Click **Create** to generate the view.

Once created, the Aggregated View will be available for dashboards, API access, and exports.

<figure><img src="https://3109056034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQfo4zX1x0hfOimS9E2u%2Fuploads%2FkVNtdAg2y6ARMMu8AXcp%2FCleanShot%202025-03-03%20at%2022.34.49%402x.png?alt=media&#x26;token=47f726ea-2439-4fbb-8836-aa425dd1b3bd" alt=""><figcaption></figcaption></figure>

### Accessing Aggregated Data

You can access Aggregated View data through:

#### **Analytics tab** under the **Device Detail** page

<figure><img src="https://3109056034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQfo4zX1x0hfOimS9E2u%2Fuploads%2FMAoYJmkQRkE2uHs3K5Dc%2FCleanShot%202025-03-03%20at%2022.35.21%402x.png?alt=media&#x26;token=7f7e01a1-203f-48ea-9263-2a4e7a36c89d" alt=""><figcaption></figcaption></figure>

#### **Dashboard Widgets** (For viewing and managing stored objects)

{% hint style="info" %}
Aggregated Views and their data are accessible through the special widget **Aggregated Chart**
{% endhint %}

<figure><img src="https://3109056034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQfo4zX1x0hfOimS9E2u%2Fuploads%2Fz5KutrcRoYt9Ap0AJg3v%2FCleanShot%202025-03-03%20at%2022.46.55%402x.png?alt=media&#x26;token=818b4595-a061-43d2-816f-3db6eadd2213" alt=""><figcaption></figcaption></figure>

#### **API queries** for programmatic access

{% content-ref url="broken-reference" %}
[Broken link](https://docs.qubitro.com/add-ons/broken-reference)
{% endcontent-ref %}

#### Example response

```json
{
    "success": true,
    "action": "get device data",
    "status": 200,
    "message": "Device data retrieved successfully.",
    "data": [
        {
            "acoustic_level_max": 93.46245132126344,
            "acoustic_level_min": 87.20657912746933,
            "temperature_max": 68.4575559158977,
            "temperature_min": 39.2556677836743,
            "time": "2025-03-03T19:00:00Z"
        },
        {
            "acoustic_level_max": 97.78007816859358,
            "acoustic_level_min": 42.27256631900725,
            "temperature_max": 79.5907532064648,
            "temperature_min": 37.220887969028894,
            "time": "2025-03-03T18:00:00Z"
        }
    ]
}
```

### Retention Period

Aggregated Views store processed data separately from the default Time Series Storage but **match** the retention period.

### Deleting an Aggregated View

To delete an Aggregated View:

1. Navigate to **Analytics** > **Aggregated Views**.
2. Select the view you want to remove.
3. Click **Delete** to remove it permanently.

{% hint style="success" %}
Deleting an Aggregated View does not affect raw device data stored in Time Series Storage.
{% endhint %}

{% hint style="danger" %}
Deleting an Aggregated View **removes all data stored in it** and cannot be undone.
{% endhint %}
