web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Segments - Is it possible to query an OR branch that includes an additional AND condition?

(0) ShareShare
ReportReport
Posted on by 112

I can't seem to figure out how to build an OR branch that also contains an additional AND clause...a "while also" if you will. 

For example, is it possible to query the following while building a segment?

Condition 1 = Value

AND ALSO

Condition A = Value

OR Condition A CONTAINS value AND Condition B does not contain data. (i.e. Condition A contains a value while also factoring in Condition B)

I ended up having to split this into two segments, as I couldn't figure out how to do an OR branch that also includes an AND as part of its condition. It'd be nice if I could have this as part of the same segment.

Thanks!

I have the same question (0)
  • Verified answer
    Nya Profile Picture
    29,060 on at

    Hi, SEDE

    If my understanding is correct, the result you need is to always satisfy Condition 1 while satisfying Condition A equals to some value or satisfying (Condition A contains a value and Condition B does not contain a value).

     

    Here is an example of a Segment for Contacts to find out all contacts meet the following conditions:

    1. First Name = F6
    2. And Also Last Name = L6
    3. Or (Last Name contains value and Account does not contain value)

     

    Which you need to do is to split the Condition 1 into the other two conditions.

    1. First Name = F6 and Last Name = L6
    2. Or First Name = F6 and (Last Name contains value and Account does not contain value)

     pastedimage1615342281988v1.png

    So adding two query block in your segment and setting the Condition 1 you need into both of them can achieve your request.

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

  • SEDE Profile Picture
    112 on at

    Very easy to understand...thanks, Nya!

  • SEDE Profile Picture
    112 on at

    Very easy to understand...thanks, Nya!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 120 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 46 Most Valuable Professional

#3
NeerajPawar Profile Picture

NeerajPawar 41

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans