Defining Logic for Query Segments

  • Updated

Set up logical expressions for your segmentation needs with query segments.

When viewing your segments or lists, click the dropdown beside the list name and choose Create a Segment (see Creating a Segment for more details). The Query method is selected by default.

The logic you use to combine your queries (AND, OR, or a CUSTOM blend) determines whether contacts need to meet all of your search requirements or only some of them.

  • AND is the strictest way to set up your query.
    • Every criterion must be met for contacts to appear in this segment (eg., job title contains 'Marketing' AND opened at least 3 messages AND lead score at least 20).
    • This will yield the smallest number of contacts but with the highest level of accuracy to the rules that you set.
    • Typically, AND is used with a variety of query types to find a specific cross-section of your audience.
  • OR is the loosest way to set up your query.
    • Only one criterion must be met for contacts to appear in this segment (eg., job title contains 'Marketing' OR job title contains 'Brand' OR company name contains 'Agency').
    • This will yield a larger segment but with a broader range of matched criteria.
    • Typically, OR is used with similar query types to allow you to cast a wider net.
  • CUSTOM lets you combine queries using both AND and OR
    • Every specific query will be given a number if you choose this option – use each number to assemble a logical statement for your segment
    • Use parentheses to indicate the grouping of related queries
    • Example:
      • Query 1 is "job title contains 'Marketing'," query 2 is "job title contains 'Brand'," and query 3 is "lead score at least 20"
      • You should likely use (1 OR 2) AND 3 to state that you need either job title, with a required lead score of 20+
    • You can assemble as many queries as you like using this method, but they can quickly become complex with multiple ANDs and ORs – check your segment often to make sure you are getting the expected results

Once you've set your logic, choose a query method.

Was this article helpful?

Have more questions? Submit a request