# Grouped-by Monitors

By utilizing Group By monitors, data teams have the ability to highlight and define specific segments within a table, like those aggregated by values in a dimension column. Following this segmentation, monitors can be applied. This functionality enables teams to not only track the overall row count of a table but also monitor counts of its individual logical subdivisions.

The configuration process for Grouped-by monitors differs from the setup routine of other monitor types, here's how you begin setting up for Grouped-by monitors.

### Setting Up Grouped-by monitoring

For initial steps you can refer to below links:

* [Set Up Freshness & Volume Monitors](https://docs.decube.io/data-quality/how-to-set-up-monitors/set-up-freshness-and-volume-monitors)
* [Set Up Custom SQL Monitors](https://docs.decube.io/data-quality/how-to-set-up-monitors/custom-sql-monitors)
* [Set Up Field Health monitors](https://docs.decube.io/data-quality/how-to-set-up-monitors/set-up-field-tests)

To configure Grouped-by monitors in Field Health follow below steps:

* **Enable “Grouped By” (if applicable)** by toggling the switch.
  * Select the column for grouping and click **Validate**.
  * A success message (**“Column is valid to be grouped by”**) confirms validation.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-4d103cf5b8ef0845e7433080d4c1d120f5929535%2Fimage%20(271).png?alt=media" alt=""><figcaption><p>Grouped-by diabled</p></figcaption></figure>

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-e7ff3ae093c6475b6b93123288587017e42daeaa%2Fimage.png?alt=media" alt=""><figcaption><p>Grouped-by enabled</p></figcaption></figure>

* Click **“Proceed to Monitor Setup”** to move to the next step.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-7b095c05fae52ad4261660b027a65477f52d2a81%2Fimage.png?alt=media" alt=""><figcaption><p>Setting-up monitor grouped-by disabled</p></figcaption></figure>

### Configure: On-demand /Schedule Monitor Grouped By for Custom SQL

* Once you select On-demand/Schedule as monitor mode, next step is click on `Proceed to monitor setup` button.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-2a67c1477df47dfd94188865a81ebb59fc7a2143%2Fimage.png?alt=media" alt=""><figcaption><p>Grouped-by enabled</p></figcaption></figure>

* Once you click on `Proceed to monitor setup` button, you will reach the next page (Configure).

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-f16f13a66c95373b96d301997e6be318440db3bd%2Fimage%20(330).png?alt=media" alt=""><figcaption><p>Overview for SQL Query validation</p></figcaption></figure>

* **Result Set Group by column:** Select from dropdown, This is the column from your query result above that contains the value to group by.
* **Result Set Mapping:** Choose the table and column where your distinct value are pulled from.

***

### Configure Grouped-by (Other Tests)

{% hint style="info" %}
Note that if the distinct values in your selected column exceeds more than 100, you will not be able to add that as a group-by column. Please reach out to us if support is required on this.
{% endhint %}

* **Fetch Values:** Click on Fetch Values button and Select group by fetching values from the grouped-by column selected
* **Search and select multiple columns:** Select from dropdown

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-bc7a37edf2a11375430111ce07519554adbd4500%2Fimage.png?alt=media" alt=""><figcaption><p>Grouped-by Configuration</p></figcaption></figure>
