# Behavior Filters in Multiple Rule Sets

The following two use cases illustrate using behavior filters in multiple rule sets:

* [Creating Segments with Flexible Behavioral Criteria](/products/customer-data-platform/audience-studio/segment/rule-operator/behavior-filters-in-multiple-rule-sets#creating-segments-with-flexible-behavioral-criteria)
* [Using Multiple Instances of the Same Behavior Field](/products/customer-data-platform/audience-studio/segment/rule-operator/behavior-filters-in-multiple-rule-sets#using-multiple-instances-of-the-same-behavior-field)


## Creating Segments with Flexible Behavioral Criteria

You can create segments where each profile must meet certain rules, but these rules don’t have to occur in the same behavior record or transaction. In short, you can combine criteria (rules) across different events or sessions to build your audience.

**Example:**

* **Goal:** Find profiles that opened the “Summer Merch Sale” campaign email and also used a mobile device.
* **Approach:** Set separate criteria for email open event and mobile usage. These conditions don’t need to occur within the same behavior record; as long as a profile meets both rules at some point, the profile will qualify.​


#### Rule Set Example

Here are segment rules with the same behavior table in multiple rule sets (different columns of *web_engagement* behavior table are in multiple rule sets - Rule Set 1 and Rule Set 2)

Segment builder showing two rule sets, each referencing different columns of the web_engagement behavior table
#### Sample Data Set

Sample web_engagement behavior table with profile IDs, campaign names, event types, and device columns
Detailed sample behavior records showing which profiles meet the rule conditions across multiple records
#### Results Explanation

For multiple rule sets, the Audience Studio’s segment builder checks if the rule conditions are satisfied in **any** of the behavior records for a profile. In this example:

* 2 profiles/ids qualify for this segment: **id_2 and id_5**
  * **id_2** : satisfies Rule Set 1 and 2 in the **same and different behavior records**
    * Record 6 contains **Open & Summer Merch Sale & Mobile**
    * Record 7 contains **Mobile**
  * **id_5** : satisfies Rule Set 1 and 2 in the **different behavior records**
    * Record 10, 11 contains **Mobile**
    * Record 12 contains **Open & Summer Merch Sale**


#### Result (Attributes Only)

Segment result table showing only attribute columns for qualifying profiles id_2 and id_5
#### Result (Attributes and Behaviors)

Segment result table showing attribute and behavior columns for qualifying profiles id_2 and id_5
**FAQ**

How are behavior filters in multiple rule sets different from having all the filters in the same rule set?

**Example:**

Segment builder showing all behavior filters combined in a single rule set
If all the filters are in one rule set, a qualifying profile needs to satisfy all filters only if it is in the same behavior record.

In the sample data set, only **id_2** would qualify and the result (attributes and behaviors) would be as follows:

Segment result for the single rule set example, showing only id_2 qualifies
## Using Multiple Instances of the Same Behavior Field

You can also create audiences that include several rules involving the same behavior field. This allows you to look for profiles that have performed similar actions multiple times or across different campaigns.

**Example:**

* **Goal:** Find profiles that accessed the “**New Album Release** ” campaign on mobile AND accessed the “**Summer Merch Sale** ” campaign on mobile.
* **Approach:** Add separate rules for mobile access to each campaign and require that both are met. This ensures the audience only includes profiles who engaged with both campaigns via mobile.


#### Rule Set Example

Segment builder showing two rule sets that each reference the same behavior field for different campaigns
#### Sample Data Set

Sample behavior table with campaign access events for multiple profiles
Detailed sample behavior records showing which profiles accessed both the New Album Release and Summer Merch Sale campaigns on mobile
#### Results Explanation

If the same column is referred in multiple rule sets with **Match Logic = all** , the Audience Studio’s segment builder checks if the rule conditions are satisfied in all behavior records of a profile. If **Match Logic = any** , it checks if the rule conditions are satisfied in at least one of the behavior records of a profile.

In this example with **Match Logic = all**:

* 2 profiles or IDs qualify for this segment: **id_1 & id_2**
  * **id_1** : behavior records satisfy Rule Set 1 and 2
    * Record 3 contains **Summer Merch Sale & Mobile**
    * Record 4 contains **New Album Release & Mobile**
  * **id_2** : behavior records satisfy Rule Set 1 and 2
    * Record 6 contains **Summer Merch Sale & Mobile**
    * Record 7 contains **New Album Release & Mobile**
* Note that **id_5** does not qualify since its behavior records only satisfies Rule Set 1 but NOT Rule Set 2


#### Result (Attributes only)

Segment result table showing only attribute columns for qualifying profiles id_1 and id_2
#### Result (Attributes and Behaviors)

Segment result table showing attribute and behavior columns for qualifying profiles id_1 and id_2