Skip to main content

How to use AND, OR, and nested filters to build audiences

Combine filters within and across filter groups, and match purchase conditions to one order, to build precise customer audiences.

Applies to: All (Users, Managers, & Admins)

Overview

Filters decide which customers end up in an audience. How you combine them decides whether your audience gets narrower or broader:

  • Within a filter group, AND or OR. Filters in the same group combine with AND by default. Switch to OR to include customers who match any of them.

  • Between filter groups, always AND. Customers must match every group to be included.

  • Purchase, message and appointment filters in the same group match the same record. Purchase History, Messages and Appointments filters joined by AND in one group must all be true of a single purchase, message or appointment. This is called nested filtering.

Filters and filter groups

A filter is one condition, such as State / Province is "NY" or Total Spent is more than or equal to $500. A filter group holds one or more filters and appears as a single bar, with an AND or OR operator between its filters. Separate filter groups appear as separate bars joined by And. To learn how to add a filter, see How to apply filters to your customers list.

AND within a group

When you add a second filter to a group, the two combine with AND. Customers must match every filter in the group, so each filter you add narrows the audience.

Example: State / Province is "NY" AND Total Spent is more than or equal to $500.

  • ✅ Customer in New York, $800 spent in total | Meets filter criteria

  • ❌ Customer in California, $900 spent in total | Doesn't meet filter criteria

  • ❌ Customer in New York, $200 spent in total | Doesn't meet filter criteria

You'd get the same customers by putting these two filters in separate groups, because groups also combine with AND. Where you place filters only changes the result for Purchase History, Messages and Appointments filters (see Nested filtering below) and when a group uses OR.

OR within a group

To include customers who match any of a group's filters, select the AND operator in the group and switch it to OR. Each filter you add to an OR group broadens the audience.

Example: You're hosting an event at your New York store. You want to invite every customer in New York, plus your top spenders elsewhere who may travel for it. In one group, add Total Spent is more than or equal to $500 OR State / Province is "NY."

  • ✅ Customer in New York, $200 spent in total | Matches State / Province

  • ✅ Customer in California, $900 spent in total | Matches Total Spent

  • ✅ Customer in New York, $800 spent in total | Matches both

  • ❌ Customer in California, $200 spent in total | Matches neither

Combining filter groups

Separate filter groups always combine with AND. Add a new group when you need a condition that every customer must meet, on top of a group that uses OR.

Example: You decide the New York event is for VIPs only.

  1. In Group 1, add Total Spent is more than or equal to $500 OR State / Province is "NY."

  2. Add a new filter group.

  3. In Group 2, add Tag is "VIP."

This finds VIP customers who are in New York or have spent $500 or more.

Nested filtering: filters that match the same purchase, message or appointment

When you join two or more filters from Purchase History, Messages or Appointments with AND in the same group, they're checked against each purchase, message or appointment on its own. A customer only matches if a single one meets all of them. For purchases, this lets you find customers by what they bought, where, and when, all on one order.

Example: Order Date is between June 1 and June 30 AND Order Location is SoHo, in one group.

  • ✅ Customer with a June order at SoHo | Meets filter criteria

  • ❌ Customer with a June order online and a January order at SoHo | Doesn't meet filter criteria, because no single order is both in June and at SoHo

  • ❌ Customer with only a June order online | Doesn't meet filter criteria

Product filters in Purchase History work the same way. Pairing a product filter with Order Location is SoHo in one group finds customers who bought that product at SoHo, not customers who bought it anywhere and also shopped at SoHo.

Messages and Appointments filters follow the same rule. Two Messages filters in one group find customers who received a single message that meets both conditions, such as a specific template sent in the past 30 days. Two Appointments filters in one group find customers with a single appointment that meets both.

When the conditions can be on different records

To find customers who meet each condition on any purchase, message or appointment, put the filters in separate groups. With Order Date is between June 1 and June 30 in Group 1 and Order Location is SoHo in Group 2, the customer with a June online order and a January SoHo order matches.

Customer Insights filters aren't part of nested filtering

Totals and averages, such as Total Spent and Total Orders, look across a customer's whole order history. Adding Total Spent is more than or equal to $500 to the June and SoHo group finds customers who spent $500 or more in total and have a June order at SoHo, not customers whose June SoHo order was $500 or more.

Troubleshooting

My audience is too small

Every AND filter and every extra group narrows the audience. Check whether customers need to match all of the conditions, or just some of them. If some are alternatives, put them in one group and switch it to OR.

My audience is too large

A group may be set to OR when you meant AND. Check the operator in each group.

My audience got smaller after the recent filter update

Purchase History, Messages and Appointments filters joined by AND in the same group now match the same purchase, message or appointment, so customers who met each condition on different ones no longer match. If that's not what you want, move those filters into separate groups. A few filters are also calculated differently. Your saved audiences still work and don't need to be rebuilt.

Excluded customers are still showing up

An exclusion filter, such as Tag is not "VIP," is likely in a group set to OR. There, a customer only needs to match one of the group's filters, so the exclusion can be bypassed. Move the exclusion into its own group. Groups always combine with AND, so it then applies to every customer.

I'm not sure which logic is being applied

Look at the layout of your filters. Filters inside one bar belong to the same group, and the operator between them shows AND or OR. Separate bars are separate groups, always joined by And. When in doubt, add filters one at a time and check the audience count after each one.

Best practices

  1. Start simple. Begin with one filter, confirm the audience looks right, then add more.

  2. Check the audience count after each filter. A sudden jump usually means a group is set to OR when you meant AND.

  3. Keep purchase conditions together. To describe one purchase, such as what was bought, where, and when, join those Purchase History filters with AND in the same group.

  4. Give exclusions their own group. That way they apply to every customer, whatever operator your other groups use.

  5. Use OR groups for alternatives. Put options that are interchangeable, such as living near your store or a high total spend, in one group set to OR.

  6. Name audiences after their logic. "NY event: New Yorkers or $500+ spenders" is far more useful than "Campaign audience 3."

  7. Test with known customers. Before launching a campaign, search for a customer you expect to be included or left out and check the result.

Still Need Help? We are happy to assist you for more 1:1 direction. Reach out to our live chat!

Did this answer your question?