Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v72
  • v74
  • v73
  • v72
Login
  • User documentation
  • FAQ
  • Altcraft glossary
  • Profiles and databases
  • Communication channels
  • Segmentation
    • Static segments
    • Dynamic segments
    • Segmentation by main information
    • Segmentation by subscriptions
    • Segmentation by action history
    • Segmentation by external data
    • Segmentation by external SQL tables
    • Segmentation by segments engagement
    • Segmentation by UTM
    • Segmentation by profile structure
    • Segmentation by best send time
    • Logical operators "AND" and "OR"
    • Quick segment
  • Message templates
  • Campaigns
  • Automation scenarios
  • Market
  • Loyalty programs
  • Reports and analytics
  • Integrations
  • Weblayers
  • Settings
  • API requests: where to start
  • Changelog
  • library
This is documentation for Altcraft Platform v72. This documentation is no longer maintained.
The information for up-to-date platform version at this page is available (v74).
  • Segmentation
  • Logical operators "AND" and "OR"
Documentation for version v72

Logical operators "AND" and "OR"

Segmentation on the platform is based on conditions. Often, a single condition is not enough to calculate the audience required for a campaign. In such cases, it is necessary to specify two or more selection conditions or group of rules. The conditions are linked together using the logical operators of formal logic - "AND" and "OR". In this article, we will use examples to explain how conditions work with these operators.

Operator "AND"​

The "AND" operator will select those subscriberss for which all rules and rule groups in the query are valid. This operator implies that all elements of the elements being joined must strictly match the condition. It can be represented schematically:

Example​

Let's model the situation. To send out an invitation to a promotional event, we need to select subscribers living in Moscow who have opened your email at least once:

The conditions will look like this:

This way, we will select those customers who meet both conditions.

Let's say you've previously created several scenarios with different offers. Now you need to select those who have not yet received messages from you:

In this case, the conditions will also be connected by the "AND" operator:

This segment will include those profiles that have not received any discount messages, emails about exclusive offers, or distributions with promo codes.

Operator "OR"​

The "OR" operator selects those profiles for which at least one rule or group of rules is valid. If a profile meets a single condition, it will be included in such a segment. The scheme of its work is as follows:

Example​

Let's assume that you came up with an idea to reward active customers with a special promo code. We will consider as active those who either made a purchase in the last 2 weeks or have more than 500 bonus points on their account:

And a condition:

If any of these conditions are met, the customer will receive a promo code.

If you need to select people from few different cities as your audience, you would also use the OR operator when building your segment:

The conditions will look like this:

info

Using a condition with the "OR" operator and negations can lead to errors. Such conditions often contain a built-in logical flaw.

Avoid using these constructions — it's better to replace them with equivalent conditions using "AND". If you do use them, be sure to double-check with a visual logic diagram.

Group of rules​

You can link multiple rules of the same level using either OR or AND, but you cannot use them together. To build complex schemes, you must use a group of rules. Within a rule group, you can use an operator different from the one used to link conditions of another level. This allows you to build more complex audiences for your marketing campaigns.

Example​

Let's explain it with an example. Let's imagine a situation in which you need to create a Viber campaign for inactive customers - for those who have received both email and SMS messages, but never made a purchase. Schematically, the audience will look like this:

For such a condition, the rule set will be composed as follows:

Last updated on Sep 19, 2024
Previous
Segmentation by best send time
Next
Quick segment
  • Operator "AND"
    • Example
  • Operator "OR"
    • Example
  • Group of rules
    • Example
© 2015 - 2025 Altcraft, LLC. All rights reserved.