# How to set different Aggregations for SQL, Google Sheets, Excel and Rest API Custom Metrics

Each SQL, Google Sheets, Excel, and Rest API Custom Metric supports only one data Aggregation function. To view the same SQL, Google Sheets, Excel, or Rest API Custom Metric with different Aggregation functions selected (i.e., "SUM" on one vs. "AVG" on another), follow the steps in this document to duplicate Custom Metrics and create the views you desire.

Custom Metrics built using native integrations and Metric Builders support multiple aggregations by default.

## How to Set different data Aggregations for SQL Custom Metrics

Navigate to  **Metrics**>  **Custom Metrics**

2  Find the Metric you'd like to set another Aggregation for, using the  **Search** bar if necessary

3 Click on the arrow next to the  **Edit** button to open the drop-down list. Select  **Duplicate.**

4 In the  **Data Aggregation Settings** section, select the  **Aggregation Function**for the Custom Metric. You can choose between **Latest, SUM, MIN, MAX, AVG**, and **Count.**

![](/assets/how-to-set-different-aggregations-for-sql-google-sheets-excel-and-rest-api-custom-metrics_1.939209810159ff5fb281c116af86f8d44d91604c7c162194ae89b766b579d156.566dd487.png)

1. Next, select the  **Data Type**. You can choose between **All Values** and **Period values**. Learn more about Data Types [here](https://developers.databox.com/metric-definition/).


![](/assets/how-to-set-different-aggregations-for-sql-google-sheets-excel-and-rest-api-custom-metrics_2.ba12dd0bc838478aa470a02a698ad356c18554b7bece73b6207191770831f910.566dd487.png)

1. To accurately explain what this Custom Metric is reporting on, set a name for your Custom Metric
2. Click  **Preview data** to generate a Data Preview of the Custom Metric
3. Once you confirm that these are the results you're looking for, click  **Save** to save the Custom Metric.


If you need our assistance setting up SQL Custom Metrics, please contact our Support Team via in-app chat or email us at [help@databox.com](mailto:help@databox.com).

How to set different data Aggregations for Google Sheets and Excel Custom Metrics

1. Navigate to  **Metrics > Custom Metrics**
2. Find the Metric you'd like to set another Aggregation for, using the  **Search** bar if necessary
3. Click on the arrow next to the  **Edit**button to open the drop-down list. Select  **Duplicate**.
4. In the  **Data Aggregation Settings** section, select the  **Aggregation Function**for the Custom Metric. You can choose between **Latest, SUM, MIN, MAX, AVG**, and **Count.**


![](/assets/how-to-set-different-aggregations-for-sql-google-sheets-excel-and-rest-api-custom-metrics_3.b970ecd85cd1c0c098af9963c272a3f78b1ba4fd5664027ca7a58705ebf4e191.566dd487.png)

1. Next, select the  **Data Type**. You can choose between **All Values** and **Period values**. Learn more about Data Types [here](https://developers.databox.com/metric-definition/).


![](/assets/how-to-set-different-aggregations-for-sql-google-sheets-excel-and-rest-api-custom-metrics_4.a071ba13aee399ffc5c4a0901850d1b7d65ca66d93fcdf9bff9c2cdce78be043.566dd487.png)

If you want to store all values to Databox that were added in your Google Sheets/ Excel for the  exact same Date/Timestamp, navigate to the **Advanced metric definition > Data Aggregations** tab and select **Store all values, even if Date/Time is an exact match to another entry** checkbox. This will store new values instead of updating existing ones data for the exact same Date/Timestamp.

1. To accurately explain what this Custom Metric is reporting on, set a name for your Custom Metric
2. Click  **Preview data** to generate a Data Preview of the Custom Metric
3. Once you confirm that these are the results you're looking for, click  **Save** to save the Custom Metric.


If you need our assistance setting up Google Sheets or Excel Custom Metrics, please contact our Support Team via in-app chat or email us at [help@databox.com](mailto:help@databox.com).

## How to set different data Aggregations for REST API Custom Metrics

1. Navigate to  **Metrics** > **Metric Library**
2. Find the Metric you'd like to set another Aggregation for, using the  **Search** bar if necessary
3. Click on the **...**hyperlink at the bottom of the Metric block
4. Select **Duplicate Metric** **.** This will open the  **Metric definition** window.
5. In order to accurately explain what this Custom Metric is reporting on, set a name for your Custom Metric in the  **Display Name** field
6. Navigate to the  **Data Aggregation** tab. In the **Data Type** section, select the  **Aggregation function**. You can choose between **Latest, SUM, MIN, MAX, AVG**, and **Count**.


![](/assets/how-to-set-different-aggregations-for-sql-google-sheets-excel-and-rest-api-custom-metrics_5.a4ad362434dd8422ba0ab7ba378fa90b4f57335324dde2886fba8bd4be76a751.566dd487.png)

1. Next, select the  **Data Type**. You can choose between **All Values** and **Period values.** Learn more about Data Types [here](https://developers.databox.com/metric-definition/).


![](/assets/how-to-set-different-aggregations-for-sql-google-sheets-excel-and-rest-api-custom-metrics_6.31eae598e65e63e5f0eef9fd03e1cd511e5c4c8fbf82ea53268cc0632bd71a2a.566dd487.png)

1. Click **Save** to save the Custom Metric


If you need our assistance setting up your REST API Custom Metrics, please contact our Support Team via in-app chat or email us at [help@databox.com](mailto:help@databox.com).