# Segment issue

**URL:** <https://forum.mautic.org/t/segment-issue/35078>\
**Category:** General Discussion\
**Created:** [February 21, 2025, 12:29am UTC](https://forum.mautic.org/t/segment-issue/35078 "2025-02-21T00:29:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rabii](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rabii/32/13080_2.png) [@rabii](https://forum.mautic.org/u/rabii)\
**Post date:** [February 21, 2025, 12:29am UTC](https://forum.mautic.org/t/segment-issue/35078/1 "2025-02-21T00:29:28Z")

</div>

Hey folks,

I am facing an issue with segments. I have build few segments and intentionally i want to exclude any contacts who have bounced email - unsubscribed email - unsubscribed manual email. In the segment builder i have added the filter as below (WITH OR STAEMENT)

> bounced - email equals no  
> OR  
> unsubscribed - email equals no  
> OR  
> unsubscribed manual - email equals no

However when the segments are built i can still see contacts who have unsubscribed i can see (DNC) icon next to contact name.

I am using mautic version 5.1.1

is this a bug or does anyone know how to solve this ?

Many thanks  
Rabii

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [February 22, 2025, 10:32pm UTC](https://forum.mautic.org/t/segment-issue/35078/2 "2025-02-22T22:32:39Z")

</div>

Not completely sure, but looks like a logical issue:  
With that definition someone could be bounced = yes and unsubscribed = no and would be in your segment.

Maybe try to build a segment with

```auto
EXLUDED SEGMENT

bounced - email equals yes
OR
unsubscribed - email equals yes
OR
unsubscribed manual - email equals yes

```

This now includes all contacts, which are in any of the yes states. Now build your segments as desired and add

```auto
AND
Segment Membership excluding EXCLUDED SEGMENT

```

Does this work?

---

<div class="post-metadata">

**Author:** ![rabii](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rabii/32/13080_2.png) [@rabii](https://forum.mautic.org/u/rabii)\
**Post date:** [February 23, 2025, 12:55am UTC](https://forum.mautic.org/t/segment-issue/35078/3 "2025-02-23T00:55:49Z")

</div>

Thanks for your reply. Sorry my mistake i am using AND logical operator rather then OR. Here is how the filter look

zipcode starts with AB9  
OR  
zipcode starts with EN10  
AND  
bounced - email equals no  
AND  
unsubscribed - email equals no  
AND  
unsubscribed manual - email equals no

This should work and get the contacts that match this query.

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [February 25, 2025, 6:13pm UTC](https://forum.mautic.org/t/segment-issue/35078/4 "2025-02-25T18:13:09Z")

</div>

as far as I know there are no condition groups. you would need to get your zipcode check into one statement. or you bundle it in a separate segment (zipcode starts with AB9 OR zipcode starts with EN10)

and in the other segment you then have all ANDs.

first one

segment membership including “ZIPCODES AB9 or EN10”

right?

---

<div class="post-metadata">

**Author:** ![rabii](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rabii/32/13080_2.png) [@rabii](https://forum.mautic.org/u/rabii)\
**Post date:** [February 25, 2025, 10:30pm UTC](https://forum.mautic.org/t/segment-issue/35078/5 "2025-02-25T22:30:16Z")

</div>

Seems currently it is a limitation. using this approach is nasty for me i have more than 100 zipcodes with different combination for each segment. Even when i tried the exclude segment membership unsubscribed still the segment would incldue the unsubscribed contacts.

Thanks for your reply. I will have to see what could be done maybe will customize the code for my instance.
