--- title: "Functions for Filtering Related Data Sets" slug: "functions-for-filtering-related-data-sets" description: "Filter and refine data sets in Mapp Engage with functions for message content, audience selection, and personalization rules to enhance your marketing strategy." status: "update" updated: 2026-09-15T13:29:05Z published: 2026-09-15T13:29:05Z canonical: "docs.mapp.com/functions-for-filtering-related-data-sets" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Functions for Filtering Related Data Sets ## Overview Using Mapp Engage functions, you can filter related data sets to meet your specific needs. These functions allow for refined selection based on time periods, specific values, or other criteria. Filters can be applied to: - Message content insertion - Audience selection - Personalization rules These functions apply within Mapp Engage. To filter and sort related data records when you read them through the REST API, see [Filtering and Sorting Related Data Records](/v1-api/apidocs/filtering-and-sorting-related-data-records-engage-api). --- ## Available Filtering Functions To work effectively with related data sets, the following functions are available: | Function | Description | | --- | --- | | [ecx:filter](https://docs.mapp.com/v1/docs/ecxfilter) | Searches a column for specific values and returns matching entries. | | [ecx:filterDateRange](https://docs.mapp.com/v1/docs/ecxfilterdaterange) | Filters entries based on date values within a specified range. | | [ecx:filterDateTimeRange](https://docs.mapp.com/v1/docs/ecxfilterdatetimerange) | Filters entries based on both date and time within a specified range. | | [ecm:addInterval](https://docs.mapp.com/v1/docs/ecmaddinterval) | Adds or subtracts a specified time interval to/from a date. | | [ecx:merge](https://docs.mapp.com/v1/docs/ecxmerge) | Merges multiple data sources into a single object. | | [ecm:countMapElements](https://docs.mapp.com/v1/docs/ecmcountmapelements) | Counts the number of elements inside a data map. | > [!NOTE] > **Note:** When using personalization rules or recipient selections, functions must return a Boolean (True/False). If a function (e.g., `ecx:filter`) does not return a Boolean value, use `ecm:countMapElements` to derive a Boolean output. --- ## Linked vs. Unlinked Related Data Sets To filter data, you must define the key of the data set being filtered. ### Linked Data Sets - The key is specified via a related attribute. - Filters apply directly based on relationships. ### Unlinked Data Sets - The key must be explicitly defined (either as an attribute or a predefined value). - Filtering requires manual key identification. > [!WARNING] > **Important:** Filters cannot be used to search all data sets for a certain value without defining the key first. The correct syntax differs between linked and unlinked data sets. ## Related - [Personalization with Related Data](/personalization-with-related-data.md) - [Use Related Data in a Message](/use-related-data-in-a-message.md)