---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps]
keyword: [Extend, Workday Query Language, WQL]
nav: wcp_docs
parent_url: /wcp_docs/
title: HAVING
layout: subsection
---

<a id="d74e275"></a>
Filters a group or an aggregate by a search condition. You can only use `HAVING` with the `GROUP BY` clause.

You can only access fields that:

-   Workday has authorized for use with the Workday Report Writer or default areas.
-   The current processing Workday account has permission to access.


## <a id="d74e289"></a>Syntax

```
HAVING condition
```

## <a id="d74e298"></a>Aggregation Functions

You can use these aggregation functions in a search condition:

<table><thead><tr><th>Aggregation Function</th><th>Description</th></tr></thead><tbody><tr><td><code>AVG(<i>field</i>)</code></td><td>Returns the average value of a numeric field.</td></tr><tr><td><code>COUNT()</code></td><td>Returns the number of instances matching the query criteria.</td></tr><tr><td><code>COUNT (DISTINCT <i>field</i>)</code></td><td>Returns the unique number of instances matching the query criteria. Use only on text and single instance fields.</td></tr><tr><td><code>MIN(<i>field</i>)</code></td><td>Returns the minimum value of a field.</td></tr><tr><td><code>MAX(<i>field</i>)</code></td><td>Returns the maximum value of a field.</td></tr><tr><td><code>SUM(<i>field</i>)</code></td><td>Returns the total sum of a numeric field.</td></tr></tbody></table><br/>

## <a id="d74e313"></a>Example

Return the count of workers by location where the number of workers is greater than 100:

```
SELECT location, count() as Count_Workers
FROM allWorkers
GROUP BY location HAVING count() > 100
```

