Filters in segmentation

On various different pages on MoEngage dashboard events, event attributes, user attributes can be filtered to get to the desired analysis or users. To get the right analysis and the right set of users, it's very important to know the filters.

This article explains how these filters work and if there are any different behavior or these filters on different pages. 

Data Types

In the MoEngage dashboard, there are 6 primary data types.

  • String
    A string is a sequence of characters. Strings are typically used to represent words and text. Character in a string can be a letter of some alphabet, a digit, a punctuation mark, a blank space, etc.

  • Boolean
    The Boolean data type can have values as true and false.

  • Numeric
    A number is a sequence of digits . Numeric data types are typically used to represent amount, quantity , price.

  • Geo Location
    Geo-Location represents the location on the map using latitude and longitude.

  • Date Time
    Date time data types represent the date and time for an event or action.

  • Array
    An array is a group of elements. In MoEngage we have 2 array data types, String Array and Numeric array.

Terms to know

  1. Key - Key is a record in the database.
  2. Key is set - Field which holds the value of an attribute.
  3. Key not set - The field is not present to hold the value of the attribute.
  4. Stored Value - User Behaviour or User Property value stored in the MoEngage Application. For example, App/Site Opened, Last Seen, Email Clicked. For more information, refer to Derived Events & Attributes.
  5. Filter Value - The value you choose to filter based on the selected stored value. For example, you can choose the filter at least and type or select the duration or number of times the App/Site is opened.

String Filters

Operator Explanation
is The stored value is an exact match with the filter value.
exists The stored value is present.
Filter users or events where the stored value exists (Key is set).
contains Stored value contains filter value.
starts with The stored value starts with the filter value.
ends with The stored value ends with the filter value.
in the following The stored value matches one of the filter values.
is not  The stored value is not a match with the filter value.
The Filter is applied to all the values of the attribute including the values that are not available (Key is not set).
does not exist The stored value is not present.
Filter is applied to all the values of the attribute including the values that are not available (Key is not set).
does not contain The stored value does not contain the filter value.
Filter is applied to all the values in the stored attribute including the values that are not available (Key is not set).
does not start with The stored value does not start with the filter value. (Key not set)
Filter is applied to all the values of the attribute including the values that are not available (Key is not set).
does not end with The stored value does not end with the filter value.
Filter is applied to all the values of the attribute including the values that are not available (Key is not set).
not in the following The stored value is not a match to any of the filter values.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

Boolean Filters

Operator Explanation
is The stored value is an exact match with the filter value.
exists The stored value is present.
does not exist The stored value is not present (Key is not set).

Numeric Filters

For the table below - N, N1, and N2 are numeric and N2 > N1.

Operator Explanation
is equal to The stored value is an exact match with the filter value.
is not equal to The stored value is not a match to the filter value.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).
is between The stored value is a match between the first filter value and the second filter value.
N1 <= Stored value AND Stored value < N2.
N1 & N2 are the first and second filter values respectively.
is not between Stored Value is not matched between the first filter value and the second filter value.
N1 > stored value OR stored value >= N2.
N1 & N2 are the first and second filter values respectively.
is less than The stored value is lesser than the filter value.
Stored value < Filter value
is greater than The stored value is greater than the filter value.
Stored value > Filter value
in the following The stored value matches one of the filter values.
not in the following The stored value does not match any of the filter values.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).
exists The stored value is present.
Filter users or events where the stored value exists (Key is set).
does not exist The stored value is not present.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

Location-triggered Filters

Operator Explanation
Point with Radius The stored geolocation value is within the circle defined by the point and the radius.

Date Time Filters

To understand filter operators in date-time data types, we need to first understand few functions -

  • now = current timestamp up to milliseconds

  • start_of_day(timestamp) = 00:00:00 of the selected day/date

  • end_of_day(timestamp) = 23:59:59 of the selected day/date

  • n days = n * 24 hours
  • For the table below - n, n1, and n2 are numeric and n2 > n1.

For example

  • Let's assume now is 7:30:05 PM, 5 Jan 2001 then
    • now - 3 days = now - (3* 24) hours = 7:30:05 PM, 2 Jan 2001
    • now + 3 days = now + (3* 24) hours = 7:30:05 PM, 8 Jan 2001
    • start of the day (now) = 12:00:00 AM, 5 Jan 2001
    • end of the day (now) = 11:59:59 PM, 5 Jan 2001
  • Let's assume date is 1 Jan 2001
    • start of day (date) = 12:00:00 AM, 1 Jan 2001
    • start of day (date + 1 day) = 12:00:00 AM, 2 Jan 2001
    • start of day (date - 1 day) = 12:00:00 AM, 31 Dec 2000
    • end of day (date) = 11:59:59 PM, 1 Jan 2001
    • end of day (date + 1 day) = 11:59:59 PM, 2 Jan 2001
    • end of day (date - 1 day) = 11:59:59 PM, 31 Dec 2000
Operator Filter Value Type Explanation
in the last n days

Stored value is
From = Start of day(Now - N days),
To = Now.
N is the filter value.

Example: If Now = 11:30:30 AM, 7 Jan 2021 & N =3.
From = 12:00:00 AM, 4 Jan 2021.
To = 11:30:30 AM, 7 Jan 2021.

on date

Stored value is
From = Start of day(Date),
To = End of day(Date).
Date is the filter date.

Example: If selected Date = 7 Jan 2021.
From = 12:00:00 AM, 7 Jan 2021.
To = 11:59:59 PM, 7 Jan 2021.

days ago

Stored value is
From = Start of day(Now - N days),
To = End of day(Now - N days).
N is the filter value.

Example: If Now = 11:30:30 AM, 7 Jan 2021 & N =3.
From = 12:00:00 AM, 4 Jan 2021.
To = 11:59:59 PM, 4 Jan 2021.

days from now

Stored value is
From = Start of day(Now + N days),
To = End of day(Now + N days).
N is the filter value.

Example: If Now = 11:30:30 AM, 7 Jan 2021, & N =3.
From = 12:00:00 AM, 10 Jan 2021.
To = 11:59:59 PM, 10 Jan 2021.

is between   date

Stored value is
From = Start of day(Date 1),
To = End of day(Date 2).
Date 1 & Date 2 are start and end date respectively.

Example: If selected Date1 = 7 Jan 2021, & Date2 = 15 Jan 2021.
From = 12:00:00 AM, 7 Jan 2021.
To = 11:59:59 PM, 15 Jan 2021.

days ago

Stored value is
From = Start of day(Now - N2 days),
To = End of day(Now - N1 days).
N1 & N2 are first and second filter value respectively.

Example: If Now = 11:30:30 AM, 7 Jan 2021, N1 = 3, & N2 = 5.
From = 12:00:00 AM, 2 Jan 2021.
To = 11:59:59 PM, 4 Jan 2021.

days from now

Stored value is
From = Start of day(Now + N1 days),
To = End of day(Now + N2 days).
N1 & N2 are first and second filter value respectively.

Example: If Now = 11:30:30 AM, 7 Jan 2021, N1 = 3, & N2 = 5.
From = 12:00:00 AM, 10 Jan 2021.
To = 11:59:59 PM, 12 Jan 2021.

before  date

Stored value is
To = End of day(Date - 1 day).
Date is the filter date.

Example: If selected Date = 7 Jan 2021.
To = 11:59:59 PM, 6 Jan 2021.

days ago

Stored value is
To = End of day(Now - (N+1) days)
N is the filter value.

Example: If Now = 11:30:30 AM, 7 Jan 2021, & N = 3.
To = 11:59:59 PM, 3 Jan 2021.

after  date

Stored value is
From = Start of day(Date + 1 day)
Date is the filter date.

Example: If selected Date = 7 Jan 2021.
From = 12:00:00 AM, 8 Jan 2021.

days from now 

Stored value is
from = Start of day(now + (N+1) days)
N is the filter value.

Example: If selected Date = 7 Jan 2021, & N = 3.
From = 12:00:00 AM, 11 Jan 2021.

in the next days

Stored value is
From = Now,
To = End of day(now + N days).
N is the filter value.

Example: If Now = 11:30:30 AM, 7 Jan 2021 & N =3.
From = 11:30:30 AM, 7 Jan 2021.
To = 11:59:59 PM, 10 Jan 2021.

is today  

Stored value is
From = Start of day(Today),
To = End of day(Today).

Example: If Now = 11:30:30 AM, 7 Jan 2021.
From = 12:00:00 AM, 7 Jan 2021.
To = 11:59:59 PM, 7 Jan 2021.

exists   The stored value is present.
Filter users or events where the stored value exists (Key is set).
does not exist   The stored value is not present.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

Array Filters

Two types of array filters are available. 

Array filters are not supported for:
  1. Entire Analytics Suite
  2. Triggers, Preference management, Conversion goal, and Personalisation attributes

Array of Strings

Description for array filters for string -

Filter Name Explanation

(any of) is

One of the stored values of the array is an exact match with the filter value.

(all of) is

All of the stored values of the array are an exact match with the filter value.

is not

All stored values of the array do not match with the filter value.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

exists

The stored value is present.
Filter users or events where the stored value exists (Key is set).

does not exist

The stored value is not present.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

(any of) contains

One of the stored values of the array contains the filter value.

(all of) contains

All of the stored value contains filter value

does not contain

All of the stored value does not contain filter value.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

(any of) starts with

Any of the stored values start with the filter value.

(all of) starts with

All of the stored value starts with the filter value.

does not start with

All of the stored does not start with the filter value.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

(any of) ends with

Any of the stored values end with the filter value.

(all of) ends with

All of the stored value ends with the filter value.

does not end with

All of the stored does not end with the filter value.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

(any of) in the following

Any of the stored values is an exact match for at least one of the filter values.

(all of) in the following

Stored values are an exact match for all the filter values.

not in the following

All of the stored value is not a match to any of the filter values.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

Array of Numbers

Description for array filters for numeric values -

Filter Name Explanation

(any of) is equal to

One of the stored values of the array is an exact match with the filter value

(all of) is equal to

All of the stored values of the array is an exact match with the filter value

is not equal to

All stored values of the array do not match with the filter value.
Stored value includes the attributes where value does not exist (Key is not set).

(any of) is between

One of the stored values of the array is a match between the first filter value and the second filter value.

N1 <= at least one of the stored values of the array AND the same value is < N2.
N1 & N2 are the first and second filter values respectively.

(all of) is between

All of the stored value of the array is a match between the first filter value and the second filter value.

N1 <= all stored values of the array AND all stored values of the array < N2.
N1 & N2 are the first and second filter values respectively.

is not between

None of the stored values of the array matches between the first filter value and the second filter value.

N1 > all stored values of the array OR all stored values of the array >= N2.
N1 & N2 are the first and second filter values respectively.

(any of) is less than

One of the stored values of the array is lesser than the filter value.

(all of) is less than

All of the stored values of the array are lesser than the filter value.

(any of) is greater than

One of the stored values of the array is greater than the filter value.

(all of) is greater than

All of the stored values of the array are greater than the filter value.

(any of) in the following

Any of the stored values is an exact match for at least one of the filter values.

(all of) in the following

Stored values of the array are an exact match for all the filter values.

not in the following

Any of the stored values is not a match to any of the filter values.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

exists

The stored value is present.
Filter users or events where the stored value exists (Key is set).

does not exist

The stored value is not present in the filter value (Key not set).

(all of) in the following

Stored values are an exact match for all the filter values.

not in the following

All of the stored value is not a match to any of the filter values.
The filter is applied to all the values of the attribute including the values that are not available (Key is not set).

Was this article helpful?
1 out of 1 found this helpful