Query and exclude (is there a NOR option)

Hi folks, I'm 2.5 weeks into the job here and trying to get through some query work.

I was trying to look at people who had donated to an Appeal up until a certain point.

I can say AppealID = X and Gift Date = [range_A→B]

But that would bring up people who may still be giving… so AppealID = X and Gift Date = [range_C→D] …

So those 2 subsets…

rangeA→D SUBTRACT range_C→D

I could make 2 different queries… export them and then in Excel do a comparator to notice the differences, but any way in one query/export?

Thanks (probably something simple and I'm just over thinking it)

Comments

  • @Ryan Moore You shouldn't need to do this in Excel. I usually try to accomplish this type of thing in Query List (Database view function not webview) if possible, but if you can't do it via a subtraction there, you can merge two queries in RE and use a NOR option.

  • Austen Brown
    Austen Brown Community All-Star
    Tenth Anniversary Kudos 5 PowerUp Challenge: Product Update Briefing Feedback Task 3 bbcon 2025 Attendee Badge

    @Ryan Moore - Here's a helpful guide for merging queries in Database View with diagrams of the available operators, no need to export to excel just yet.


  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Ryan Moore
    I think you really are overthinking it.

    first of all.. you are simply looking for gifts from a certain ONE appeal, simple enough.

    Then it is the date range, you have 4 variables used in your date range: A, B, C, D. if you get clear on what exactly it is you want out of the date range, then it's likely a simple query.

    You mentioned:

    range A to B
    range C to D (this is where it is unclear, is C after B or before)
    finally you mention A to D subtract C to D.

    Assuming you didn't have a typo:

    if:
    A=2/5
    B=2/10
    C=2/15
    D=2/20
    where C is later than B
    THEN your date range is just 2/5-2/14, that's ONE date criteria range using:
    “Gift Date” between 2/5 and 2/14
    OR you can do TWO date criteria using:
    “GIft Date” is on or after 2/5
    AND “Gift Date” is before 2/15

    if:
    A=2/5
    B=2/10
    C=2/8
    D=2/20
    where C is actually earlier than B
    THEN your date range is just 2/5-2/7.

  • @Christine Robertson & @austen brown

    thanks, didn't know about ‘merge’ (just finishing up my 3rd week here)

    What I'm trying to find is the employee givers who gave up to a certain point, and stopped giving after a certain point

    So what I did is made 2 queries

    All time & Post time

    So ‘all time’:

    • Constituency Code NOT = past employee
    • & ( Appeal ID = Employee Giving & Gift Date greater than 01/01/2013)

    For Post

    • Constituency Code NOT - past employee {want to make sur they didn't stop because they're now retired}
    • & ( Appeal ID = Employee Giving & Gift Date greater than 01/01/2020)

    The hope is that We find donors who have given since 2013, and then donors who've given since 2020. The exclusion list of it should be people who gave in 2013 up until 2020 but weren't in the list of 2020 and beyond.

    I ran a merge using XOR (seemed the best way to subtract), but getting 0 hits

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Ryan Moore
    If i'm understanding you correctly, you want list of constituent who gave to certain appeal within a date range but want to remove those that is giving in another range.

    Constituent Query:
    Summary of Gift Amount (sub-criteria: appeal=XXX gift date: Between 1/1/2013-12/31/2019) greater than $0
    AND
    Summary of Gift Amount (sub-criteria: appeal=XXX gift date greater than or equal to 1/1/2020) equals to $0
    AND
    Constituent Code criteria

  • @Christine Robertson
    thanks folks, didn't know about the query merge feature (did I mention - newbie… just finishing week 3)

    So what I really want to do is find a list of employees people who gave up until a point, and then stopped giving

    What I did was 2 queries ‘givers since A’ and then ‘givers since B' (which is after A)

    First

    • Constituency Code NOT= past employee {don't want to find out they stopped because they retired}
      AND ( Appeal ID = Employee Giving AND Gift Date greater than A )

    Then

    • Constituency Code NOT= past employee
    • AND ( Appeal ID = Employee Giving AND Gift Date greater than B )

    From these did that Query Merge

    First Query XOR Then Query … what it should be doing (if I'm guessing right) is find all those who have given from A, but then subtract those who have given from B (i.e. they were in A, but also in B).

    So let's say I pick Jan 1 2013 and Jan 1 2020

    If anybody gave any time after Jan 1 2013, but then also gave after Jan 1 2020 they should be excluded…

  • @Ryan Moore If I'm understanding your end objective correctly, I think what you could do is add the first query that you mentioned to a Query List. Then, if you want to remove those who stopped giving prior to 2020, you could create a second query of Last Gift Date before 12-31-20. In Query List, you can use the Remove function to subtract those in the second query from the starting query.

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Ryan Moore

    No need for merge query, just one Constituent Query:
    Summary of Gift Amount (sub-criteria: appeal=XXX gift date: greater than 1/1/2013) greater than $0
    AND
    Summary of Gift Amount (sub-criteria: appeal=XXX gift date greater than or equal to 1/1/2020) equals to $0
    AND
    Constituent Code criteria

  • hey everybody… thanks for all the responses… was able to chat with our office colleagues, turns out what I was missing was using the right “Appeal ID”, it's a field in a couple spots and I was using the Assigned Appeal ID, meaning they've responded to a specific campaign (turning the lingo), versus the gift we received as assigned what appeal ID.

    /d'oh

  • Austen Brown
    Austen Brown Community All-Star
    Tenth Anniversary Kudos 5 PowerUp Challenge: Product Update Briefing Feedback Task 3 bbcon 2025 Attendee Badge

    @Ryan Moore - I'm glad you figured it out!

Categories