---
title: "Subquery Filters & Aggregates"
slug: "subquery-filters"
updated: 2026-04-02T20:58:23Z
published: 2026-04-02T20:58:23Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Subquery Filters & Aggregates

A subquery filter looks across the 'many' of the one-to-many relationships in Slate to determine which records to return in a query. Several aggregate functions can be used to filter records based on values on other query bases, including:

- Exists
- Not Exists
- Comparison
- Formula
- Count
- Count Distinct
- Average
- Median
- Minimum
- Maximum
- Sum
- Standard Deviation
- Variance

#### Subquery copy/paste

Use `ctrl/cmd + c` to copy an existing subquery export. Paste into a new subquery export with `ctrl/cmd + v`.

> [!WARNING]
> 📝 **Note:** Check your****[browser's clipboard settings](chrome://settings/content/clipboard) if you find you can’t copy/paste subqueries.

![](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/Subquery filter copy paste.png)

#### Subquery counts

A count of **Matching Rows**shows the number of records returned by the subquery.

![](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/Matching Rows.png)

#### Subquery check logic

Select **Check Logic**![](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/Check Logic(1).png) and enter the name of a record to see whether it meets your subquery export’s filter criteria.

![](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/Check subquery filter logic - sample record.png)

## Exists

The Exists function can limit query results based on the existence of a related record on another base. For example, to filter for person records that have an application, the subquery filter should include a join to Applications:

[![sub_filter_exists.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_exists.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_exists.jpg)

## Not Exists

Similarly, there is a Not Exists function, which is used to limit the query results to those where there are no matching records on the related table or no value for the specified export. For example, No Address:

[![sub_filter_not_exists.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_not_exists.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_not_exists.jpg)

## Count

The Count Aggregate function is used to return records based on the specified count of related records, such as querying for person records that have greater than or equal to three test scores:

[![sub_filter_count.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_count.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_count.jpg)

## Average

Subquery filters can also perform calculations on exports from related bases, such as limiting the query results of person records to those where the average school GPA is greater than or equal to a 3.0:

[![sub_filter_average.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_average.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_average.jpg)

## Minimum

Aggregate functions can also be used to limit records based on the minimum value. In this example, person records are being returned when the lowest gift amount is less than $100:

[![sub_filter_min_gift.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_min_gift.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_min_gift.jpg)

## Maximum

Similarly, a function type of Maximum may be selected. For example, a query of person records can be filtered based on the maximum ping duration:

[![sub_filter_max.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_max.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/sub_filter_max.jpg)

## Sum

An aggregate function can also evaluate the sum of values from related records, such as returning person records where the sum of work experience across multiple jobs is greater than 60 weeks:

[![job_duration.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/job_duration.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/job_duration.jpg)

## Comparison

Subquery filters may also be used to compare two values of the same type, such as dates, integers, reals, or strings. For example, the comparison filter may be used to return records where the Application Major and the Person Major are not the same:

[![comparison_filter.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/comparison_filter.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/comparison_filter.jpg)

## Formula

Finally, formulas may be used to limit the results of a query. To create a filter for Last Name Contains, for example, add the export of Person Last. In combination with the LIKE operator, use A% to find names that start with A or [A-F]% to find names that start with A-F:

[![mceclip1.jpg](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/fa84vgjco0aleluvnzpnamceclip1.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/fa84vgjco0aleluvnzpnamceclip1.jpg)

> [!TIP]
> ✨ Tip
> 
> Type @ in the Formula box to see a list of suggested exports and # to see a list of suggested functions.
> 
> [![filter_formula.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/filter_formula.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/filter_formula.jpg)
> 
> 
> 
> [![formula_filter.JPG](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/datediff.jpg)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/datediff.jpg)
