# Group filters for segments

**URL:** <https://forum.mautic.org/t/group-filters-for-segments/12692>\
**Category:** Ideas and Feature Requests\
**Created:** [February 10, 2020, 5:13pm UTC](https://forum.mautic.org/t/group-filters-for-segments/12692 "2020-02-10T17:13:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 10, 2020, 5:13pm UTC](https://forum.mautic.org/t/group-filters-for-segments/12692/1 "2020-02-10T17:13:16Z")

</div>

Posting from GH issue: [https://github.com/mautic/mautic/issues/6636](https://github.com/mautic/mautic/issues/6636)

When creating the filter on a segment, i currently cant filter with multiple grouped or values.  
i.e.  
‘Tags’ Include ‘Number 1’  
AND  
( Stage != ‘A’, OR ‘B’, OR ‘C’)

The returned value I would expect would be "All contacts with a Tag or “Number 1” that is NOT in stages A, B. or C .

If I am understanding it correct, currently i would have to write it as:

Tags Include “Number 1” and Stage != ‘A’  
OR  
Tags Include “Number 1” and Stage != ‘B’  
OR  
Tags Include “Number 1” and Stage != ‘C’

Which is very wasteful.

My request is that we be able to group the filters as:

'Tags Include ‘Number 1’  
AND  
{ Stage != ‘A’  
OR  
Stage != ‘B’  
OR  
Stage != ‘C’ }

---

<div class="post-metadata">

**Author:** ![stgoos](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stgoos/32/8149_2.png) [@stgoos](https://forum.mautic.org/u/stgoos)\
**Post date:** [December 20, 2022, 2:53pm UTC](https://forum.mautic.org/t/group-filters-for-segments/12692/2 "2022-12-20T14:53:48Z")

</div>

I’m experiencing the same struggle that Mautic is far far from user friendly when it comes to constructing segment filters.

A much more user friendly way is to do it, for example, like: [QueryBuilder.js.org](https://querybuilder.js.org/demo.html)

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/213d6b91f27eed96f5b53f52a43b2561d27d1e52.png)

_Although the colors in the AND | OR selector need to be further apart from each other, I would go for grey and green (or blue)._

That said, I would also love to be able to set an **AND NOT** filter so you can make something like

**_AND NOT_ Sent any mail (date) _greater than or equal_ 2022-12-01 00:00**

which is **NOT** the same as

**_AND_ Sent any mail (date) _less than_ 2022-12-01 00:00**

The NOT option is also available in the QueryBuilder, see the last 2 demo’s.

You can also take a look at my Bootstrap 5 and FontAwesome 6 compatible adjustments at: [https://jsfiddle.net/golabs/wL0jgt2a](https://jsfiddle.net/golabs/wL0jgt2a)
