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

Notifications

Announcements

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 101

#1
Pallavi Phade Profile Picture

Pallavi Phade 101

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans