OperatorDescription
equal toInclude profiles that are exactly equal to the selected value.
not equal toInclude profiles that are not equal to the selected value.


Review the following Operator information to help you create accurate SQL code for your segment attribute conditions.

equal to

Use the equal to operator to include profiles that are exactly equal to the selected value.

Example

Match all profiles in which the gender is Female.

SQL Example


select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_1249"."customers" a
where a."gender" = 'Female'
-- set session distributed_join = 'true'
) cs

not equal to

Use the not equal to operator to include profiles that are not equal to the selected value.

Example

Match all profiles in which the gender is not Male.

SQL Example


select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_1249"."customers" a
where not coalesce(a."gender" = 'Male', false)
-- set session distributed_join = 'true'
) cs

greater than

Use the greater than operator to match all profiles that are greater than the specified value.

Example

Match all profiles with a likely_to_shop score greater than zero.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_1249"."customers" a
where a."td_predictive_score_177" > 0
-- set session distributed_join = 'true'
) cs

greater than or equal to

Use the greater than or equal to operator to match all profiles that are greater or equal to the selected value.

Example

Match all profiles with a likely_to_shop score greater than OR equal to zero.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_1249"."customers" a
where a."td_predictive_score_177" >= 0
-- set session distributed_join = 'true'
) cs

less than

Use the less than operator to match all profiles that are less than the selected value.

Example

Match all profiles with a likely_to_shop score less than 10.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_1249"."customers" a
where a."td_predictive_score_177" < 10
-- set session distributed_join = 'true'
) cs

less than or equal to

Use the less than or equal to operator to match all profiles that are less than or equal to the selected value.

Example

Match all profiles with a likely_to_shop score less or equal to 10.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_1249"."customers" a
where a."td_predictive_score_177" <= 10
-- set session distributed_join = 'true'
) cs

contains

Use the contains operator to match all profiles that contain the selected value.

Example

Match all profiles where the company contains Johnston LLC.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_6148"."customers" a
where position('Johnston LLC' in a."company") > 0
-- set session distributed_join = 'true'
) cs

starts with

Use the starts with operator to match all profiles that begin with the selected value.

Example

Match all profiles where the company begins with Johnston LLC.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_6148"."customers" a
where position('Johnston LLC' in a."company") = 1
-- set session distributed_join = 'true'
) cs

ends with

Use the ends with operator to match all profiles that end with the selected value.

Example

Match all profiles where the company ends with LLC.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where substr(a."company", -length('LLC'), length('LLC')) = 'LLC'
-- set session distributed_join = 'true'
) cs

regex

Use the regex operator to match all profiles based on a regular expressions pattern (regex). You must provide the regex pattern that works for your use case.

Example

Match all profiles where the job_title begins with 'Manager', based on the regex expression: ^Manager.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where regexp_like(a."job_title", '^Manager')
-- set session distributed_join = 'true'
) cs

not regex

Use the not regex operator to not match all profiles based on a regular expressions pattern (regex). You must provide the regex pattern that works for your use case.

Example

Match all profiles where the company does not end with the word google based on the regex pattern google$.

SQL Example

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(regexp_like(a."company", 'google$'), false)
-- set session distributed_join = 'true'
) cs


not regex

does NOT match based on a regular expressions pattern (regex). You must provide the regex pattern that works for your use case.

match all profiles where the company does not end with the word google based on the regex pattern google$.


select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(regexp_like(a."company", 'google$'), false)
-- set session distributed_join = 'true'
) cs


is between

between two provided values

match all profiles with a likely_to_shop score between 10 and 20.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where (a."likely_to_shop" between 10 and 20)
-- set session distributed_join = 'true'
) cs

does not contain

does not contain the selected value

include all profiles where the company does not contain Johnston LLC.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(position('Johnston LLC' in a."company") > 0
-- set session distributed_join = 'true'
) cs

does not start with

does not begin with the selected value

include all profiles where company does not start with Johnston LLC

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(position('Johnston LLC' in a."company") = 1
-- set session distributed_join = 'true'
) cs

does not end with

does not end with the selected value

include all profiles where the last_name does not end with Saint John.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(substr(a."last_name", -length('Saint John'), length('Saint John')) = 'Saint John'
-- set session distributed_join = 'true'
) cs

is one of

one of the selected options

include all profiles where the job_title is either 'VP Marketing' or 'VP sales' or 'VP Product Management'.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where a."job_title" in ('VP Marketing','VP sales','VP Product Management')
-- set session distributed_join = 'true'
) cs

is not one of

not one of the selected options

include all profiles where the job_title is NOT Teacher or Physical Therapist or Chemical Engineer.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(a."job_title" in ('Teacher','Physical Therapist','Chemical Engineer'), false)
-- set session distributed_join = 'true'
) cs

is not between

not between the selected values

include all profiles where the likely_to_shop_score is not between 31 and 40.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce((a."likely_to_shop_score" between 31 and 40), false)
-- set session distributed_join = 'true'
) cs

exists

where the selected attribute exists

match all profiles that have an affinity_sub_category score.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where a."affinity_sub_category" is not null
-- set session distributed_join = 'true'
) cs

does not exist

does not exist

match all profiles that do not have a td_ip_city_postal_code value.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where a."td_ip_city_postal_code" is null
-- set session distributed_join = 'true'
) cs

does not exist or greater than

does not exist or is greater than a certain value

match all profiles that do not have a td_ip_city_postal_code_value or have a td_ip_city_postal_code_valuegreater than 94119.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(a."td_ip_city_postal_code" <= '94119', false)
-- set session distributed_join = 'true'
) cs

does not exist or greater than or equal to

does not exist or is greater than or equal to a certain value

match all profiles that do not have a td_ip_city_postal_code_value or have a td_ip_city_postal_code_valuegreater than or equal to 94119

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(a."td_ip_city_postal_code" < '94119', false)
-- set session distributed_join = 'true'
) cs

does not exist or less than

does not exist or is less than a certain value

match all profiles that do not have a td_ip_city_postal_code_value or have a td_ip_city_postal_code_value less than 94119

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(a."td_ip_city_postal_code" >= '94119', false)
-- set session distributed_join = 'true'
) cs

does not exist or less than or equal to

does not exist or is less than or equal to a certain value

match all profiles that do not have a td_ip_city_postal_code_value or have a td_ip_city_postal_code_value less than or equal to 94119.

select count(*) from (
select
a."cdp_customer_id"
from "cdp_audience_409"."customers" a
where not coalesce(a."td_ip_city_postal_code" > '94119', false)
-- set session distributed_join = 'true'
) cs


When creating a segment, certain values might not appear in the contains dropdown. Only a sample subset of available values are used when generating the data used to populate the dropdown with a max 1000 records shown in the dropdown. You can manually enter the field name in instances where it does now appear in the dropdown.