Operator options when creating segments

Operators tell Leanplum how to compare each user to your segment. For example, if you want to create a segment of users based on their Minutes previously spent in the app, you could build a segment of users with less than 5 minutes of usage, greater than 100 minutes, or between 20 and 50 minutes of prior app usage.

TargetMinutesSpent.png

Below is a table that defines all of Leanplum's operator options. Note that different types of segment criteria use different operators, and not all operators are available for all segment types. The "is greater than" operator, for example, only works with segment criteria that return numbers (e.g. is greater than 4).

Operators for segment criteria

Occurrences

For Occurrence examples, let's assume we have a shopping app with a user attribute called "rewardsLevel" that has three possible values: bronze, silver, and gold. 

Operator

Definition

Example 

is any

All possible values, including the possibility of having no value set.

Target users with all three rewards statuses and any users without a status.

Segment criteria: User attribute > rewardsLevel > is any.

is set

Value is present for this user, excluding users with no value set.

Target users with one of the three rewards statuses.

Segment criteria: User attribute > rewardsLevel > is set. 

is not set

Value is not present for this user.

Target users with no rewardsLevel set.

Segment criteria: User attribute > rewardsLevel > is not set.

is

Equal to specific value(s).

Target just gold rewards members.

Segment criteria: User attribute >rewardsLevel > is > gold.

is not

Everything except specific value(s).

Target bronze and silver rewards members (all except gold).

Segment criteria: User attribute >rewardsLevel > is not > gold.

 

Numeric

For Numeric Examples, let's assume our shopping app has an attribute "rewardsPoints," which requires a numeric value between 1 and 100. 

Operator

Definition

Example

is greater than

Is more than a number.

Target users who are close to reaching the next rewards level (takes 100 points).

Segment criteria: User attribute > rewardsPoints > is greater than > 90.

is less than

Is less than a number.

Target users who have a long way to go before reaching the next level.

Segment criteria: User attribute > rewardsPoints > is less than > 10.

is at least

Is greater than or equal to a number.

Target users with 90 or more points.

Segment criteria: User attribute > rewardsPoints > is at least 90.

is at most

Is less than or equal to a number.

Target users with 10 or fewer points.

Segment criteria: User attribute > rewardsPoints > is at most > 10.

is between

Is within a specific range.

Target mid-level users.

Segment criteria: User attribute > rewardsPoints > is between > 20 > and > 80.

 

Text

Note: Do not put brackets or quotation marks around the text value (string) in your target phrase or segment search. Doing so may prevent the correct users from being filtered into your segment.

Just use the operator with the exact characters or text for your value. Example: First Name contains a is correct, but contains "a" or contains ["a"] will not return a user named Adam. See the image below for an example of the right way to use the 'contains' operator. 


containsA.png

Operator

Definition

Example

contains

Contains specific text.

Target silver and bronze rewardsLevels. 

Segment criteria: User attribute > rewardsLevel > contains > e

The 'e' character will match characters in silver and bronze, but not in Gold.

does not contain

Does not contain specific text.

Target Gold level rewards users.

Segment criteria: User attribute > rewardsLevel > does not contain > e 

Silver and bronze levels will be filtered out because both contain the character 'e'

 

Boolean

Operator

Definition

Example

is on

True

Push support is on.

is off

False

Push support is off.

 

 

Time

See below for accepted formats for timing operators. 

Operator

Definition

Example

is past

Happened after the given time.

Session start in Pacific time is after 1/2/15.

is prior to

Happened before the given time.

Session start time in user's timezone is before yesterday.

is since

Happened at or after the given time.

Session start in user's timezone is after 1/2/15.

is until

Happened at or before this point.

Any sessions logged before 1/2/15.

is not until

Did not happen or happened after the given time.

Sessions did not happen before 1/2/15.

is not since

Did not happen or happened before the given time.

No session after 1/2/15.

is between

Happened between 

Session happened between yesterday and 08:00 AM.

This target would return users who used the app any time after midnight yesterday up until 08:00 AM today.

Target users with upcoming birthdays: User Attribute > birthday is between yesterday and today.

Leanplum accepts many different date and time formats for use with our time-specific segment operators:

  • MM/DD/YYYY -->  08/05/2015
  • MM/DD/YY --> 08/05/15
  • X months ago (weeks, days, hours, or minutes are also accepted) --> 3 days ago
  • month day at XX:XX AM/PM --> March 5 at 12:00 AM
  • MM/DD/YY XX:XX AM/PM --> 5/13/16 12:01 am
  • MM/DD/YY  XX:XX UTC --> 5/13/16 00:00 to 5/13/16 23:59 
  • Yesterday, today, or tomorrow --> between yesterday and today

Note: If a date without a time is specified, the time will default to midnight (00:00) that day. 

Only use inequality operators with times, such as since, prior to, and between. The operator “is” will not match any users.

For more in-depth examples, see Time-related targeting operators

 


Was this article helpful?
Have more questions? Submit a request