This section shows how to use the segment editor to create some common types of expressions. Note that the examples use the > symbol to indicate separate dropdown menus in the expression editor.

Including a Segment in the Expression

To include an existing segment, either alone or as part of a more complex expression, use the People in group option and then select the segment you want from the list that appears.

Expressions Using “Or”

To create an expression that uses either of two different properties to define a segment, for example People whose country is USA or whose locale is en_US, create two expressions and use “or” between them, as shown:

Days Before an Annual Event

If your profile repository has been set up to include a property that can calculate the number of days before an annual event (see the ATG Outreach Administration and Development Guide), you can create expressions that use the number of days before the event to create the segment group. For example:

People whose > DaysBeforeBirthday > is > 10 > .
Expressions Using Age

Your profile repository may include a custom age property that you can use to include people of a given age (see the ATG Outreach Administration and Development Guide). Otherwise, you can specify an age using the date of birth property, which is provided by default, with the “relative date” expression. For example,

People whose > date of birth > is after > relative date > 35 > years >
ago > .

This expression would include people who are younger than 35 (assuming their date of birth is specified in their profile).

To select the relative date expression, click the diamond element, as shown below, and choose Relative Date.

One of X, Y, or Z

To create an expression such as the following:

People whose first name is Damien, Daniel, or David

use the “is one of” operator in the segment editor, as shown:

Note that you select the commas from the dropdown menus rather than typing them.

Nested Expressions

You can create nested expressions, such as the following:

People whose gender is male and (people whose first name is David or
Damien).

To do so, use the bracket symbol in the second People whose dropdown list to enclose the second part of the expression, as follows:

People whose > gender > is > male > and > ( > people whose > first name >
is > David > or > first name > is > Damien > ) > .
Expressions Using One-To-Many or Many-to-Many Tables

ATG Outreach supports expressions that query one-to-many database table relationships, where a record in one table can have a reference to multiple records in another. It also supports many-to-many relationships, where one record in either table can refer to many records in the other table. In ATG Outreach, you use this type of query to set up expressions such as the following:

People who have at least one child who is 9 months old

where “people” is a record in one table and “child” is a record in another table. The “people” record has a property called “child” that points to the other table. Use this syntax in the segment editor:

People whose > children > contains an item whose > ageDays > is > 270 > .

You could use this expression as part of a retention campaign, for example, where you run the campaign every day to remind parents to sign their children up for a toddler program that starts when the child is 1 year old. Every day, the segment includes a different set of people (people whose children are exactly 270 days old).

Relative Dates

To create an expression that uses a relative date rather than a specific date, for example

People whose registration date is at least one year ago

use the following expression:

People whose > registration date > is before > relative date > 1 >
years > ago > .
“Is Between” with Relative Dates in the Past

To create an expression that uses “is between” with relative dates in the past, for example to include people whose birthday was 1 or 2 weeks ago, use the following syntax:

People whose > date of birth > is between > relative date > 2 >
weeks > ago > and > relative date > 1 > weeks > ago > .

Note the order of the constants in this example. Usually the greater constant appears on the right side of an operator. In this case, the rule appears to be reversed. But because the expression is in the past (“ago”), 1 is greater than 2 and therefore appears on the right of the operator “is between.”