How to build rules and rulesets¶
Overview¶
In Segment Builder, you define who belongs in a segment by adding rules.
A rule is based on an attribute, an operator, and a value (for example, Age > 30).
You can combine multiple rules into a ruleset to create more complex logic, such as Age > 30 AND Region = East.
Condition operators¶
You can connect rules with condition operators. Three types are available:
-
OR – one of the rules must be true.
Example: Region = East OR Region = West → customers from either region. -
AND – all rules must be true.
Example: Age > 30 AND Spend > 100 → customers over 30 who also spent more than 100. -
AND NOT – the first rule must be true and the second must not.
Example: Region = East AND NOT Loyalty tier = Bronze → East customers, excluding Bronze members.
When adding AND/OR conditions, groupings appear around attributes in a nested structure.
- You can lock a group by clicking the lock icon, so the grouping does not change if you adjust conditions inside.
- This makes it easier to manage complex filters.
To delete a rule, click the rule and then click Delete criteria.
Rule operators¶
The operators you can use depend on the type of attribute.
Numeric attributes¶
- Less than – value is lower than the number you specify.
- Less or equal – value is lower or equal to the number you specify.
- Equal – value matches the number you specify.
- Greater than – value is higher than the number you specify.
- Greater or equal – value is higher or equal to the number you specify.
- Between – value is between two numbers (min and max).
Date attributes¶
- Less than – date is earlier than the selected date.
- Less or equal – date is earlier or equal to the selected date.
- Equal – date matches the selected date.
- Greater than – date is later than the selected date.
- Greater or equal – date is later or equal to the selected date.
- Between – date is between two dates:
- Fixed – static dates that do not change.
- Float – relative to today, such as 60–30 days ago. Each time the segment runs, it recalculates relative to the refresh date.
Select attributes¶
Used for dropdown attributes such as Store, Loyalty tier, etc.
- Equal – matches the selected value.
- Not equal – does not match the selected value.
- In – matches any of the selected values.
- Not in – excludes all selected values.
- Contains – text includes the phrase you type (used on very few attributes).
Product attributes¶
For hierarchical Product attributes:
- You can select levels 2–9, or drill down to the product level.
- To select specific products, always choose from the furthest right column.
Example¶
To target women aged 25–40 who bought pet food in the last 30 days:
- Add rule Gender = Female.
- Add rule Age between 25 and 40.
- Add rule Product = Pet food.
- Add rule Purchase date = last 30 days.
- Connect all with AND.