Negative Criteria in Multiple 1-Many Queries
I'm trying to create a dynamic constituent query but I want to exclude people who had Action A done to them during 2015 (amongst other criteria).
At first I tried adding in
But this doesn't work. Neither does reversing the terms, or getting rid of the brackets or putting does not equal This Calendar Year...AND (Action Type does not equal Action A
AND Action Date equals This calendar yr)
Trying to find a work around I resorted to
In other words including all constituents without actions, or an action before this year, but still no joy. Also using a one of on all the other action types doesn't work as each constituent can have multiple actionsAND
(First Action Import ID blank
OR (Action Date equals This calendar yr
AND Action Type does not equal Action A)OR Action Date between 01/01/1985 AND 31/12/2014)
Any ideas? A good NOT operator would be really useful.
[Some of it I think is linked to another problem I have is the difference between a person with an Action Type A in April 2013 and someone who has an Action A from previous year but just so happens to have an entirely different action (say, an email) that is dated during April 2013. They meet both the first criterion AND the second, so how do you distinguish between the two?]
Matt
Comments
-
Have you tried creating a separate query for those who do have action A during 2015, then merging the two queries using the SUB operator?0
-
Alan French:
Have you tried creating a separate query for those who do have action A during 2015, then merging the two queries using the SUB operator?Thanks Alan, it may come to that, but I think then I'd lose the dynamic functionality as the merged queries automatically become static(?).
0 -
Good point about the static results.
How about this then:First Action Import ID blank
OR Action Type does not equal Action A
OR Action Type equals Action A
AND Action Date not between [year_start] AND [end_date]
The only downside is that you would have to keep amending the dates manually, or set the end date a long way in the future perhaps.0 -
On the Action Type criteria, try "one of" or "not one of" instead of "equals" or "not equals." I've noticed that when you've got multiple one-to-many fields in situations like this that RE can be seemingly inconsistent about whether or not it keeps those fields "properly connected" when doing the selection (that it looks at the Action Date specific to that particular Action with Action Type of Action A, or whether it looks at ALL Actions that might meet that date criteria). Sometimes bracketing the two helps, sometimes it doesn't. I've seen other posts hinting that where in the Criteria list that bracketing occurs might change the results, so try moving that bracketted set to the top or bottom of the Criteria and see if that changes anything. Viewing the actual SQL that RE generates (CTRL+Q) has helped me diagnose strange results before but it's not for the faint of heart.
While it can get really tricky, particularly when you're excluding people based on certain criteria, you could also try using another Query as the source for your final Query (Tools > Query Options > Record Processing > Select from query). That will let you combine multiple Queries and still keep the results dynamic.0 -
A merged query is the best way to go in your example. While the merge is a static query, you can simply refresh the merge any time you need by pressing F5 on the results tab. Or, if you use REQueue you can set the merge query to refresh automatically for you.0
-
John Heizer:
On the Action Type criteria, try "one of" or "not one of" instead of "equals" or "not equals." I've noticed that when you've got multiple one-to-many fields in situations like this that RE can be seemingly inconsistent about whether or not it keeps those fields "properly connected" when doing the selection (that it looks at the Action Date specific to that particular Action with Action Type of Action A, or whether it looks at ALL Actions that might meet that date criteria).
I think this gets to the heart of the problem. I can never quite work this out eiter. I asked one of the RE trainers this once, but at the end of the discussion I still don't think they had quite understood the question/scenarios I was citing. In this cases the "(not) one of" options didn't seem to change much.John Heizer:
While it can get really tricky, particularly when you're excluding people based on certain criteria, you could also try using another Query as the source for your final Query (Tools > Query Options > Record Processing > Select from query). That will let you combine multiple Queries and still keep the results dynamic.I think I'll try this in future. I have been a bit unsure about this (had maybe assumed that it was static even though it seemed like it shouldn't be). I'm not quite ready for SQL yet. Yet.
Thank you
0 -
Debra Holcomb:
A merged query is the best way to go in your example. While the merge is a static query, you can simply refresh the merge any time you need by pressing F5 on the results tab. Or, if you use REQueue you can set the merge query to refresh automatically for you.Ah, OK, thanks. I was aware of the refresh a static query thing, but I wasn't quite sure what happened once you had saved it. If I save it for this month and then refresh it next month, will that still work?
0 -
Matthew Page:
Debra Holcomb:
A merged query is the best way to go in your example. While the merge is a static query, you can simply refresh the merge any time you need by pressing F5 on the results tab. Or, if you use REQueue you can set the merge query to refresh automatically for you.Ah, OK, thanks. I was aware of the refresh a static query thing, but I wasn't quite sure what happened once you had saved it. If I save it for this month and then refresh it next month, will that still work?Not sure what you mean by "will that still work". If you refresh a merged query, either manually or via queue, it'll run itself again based on the criteria of the two input queries.
If you need to change the criteria each month, it won't be automatic -- but there are all the this month, last month, last week, etc. criteria on dates, so you might be able to finagle something there.
0 -
P.S. I totally agree with you about RE not having a good NOT function. I can't tell you how many times I've wished for the ability to do X AND NOT (Y OR Z)0
-
Matthew Page:
John Heizer:
On the Action Type criteria, try "one of" or "not one of" instead of "equals" or "not equals." I've noticed that when you've got multiple one-to-many fields in situations like this that RE can be seemingly inconsistent about whether or not it keeps those fields "properly connected" when doing the selection (that it looks at the Action Date specific to that particular Action with Action Type of Action A, or whether it looks at ALL Actions that might meet that date criteria).
I think this gets to the heart of the problem. I can never quite work this out eiter. I asked one of the RE trainers this once, but at the end of the discussion I still don't think they had quite understood the question/scenarios I was citing. In this cases the "(not) one of" options didn't seem to change much.John Heizer:
While it can get really tricky, particularly when you're excluding people based on certain criteria, you could also try using another Query as the source for your final Query (Tools > Query Options > Record Processing > Select from query). That will let you combine multiple Queries and still keep the results dynamic.I think I'll try this in future. I have been a bit unsure about this (had maybe assumed that it was static even though it seemed like it shouldn't be). I'm not quite ready for SQL yet. Yet.
Thank youBeing able to base one dynamic query on the results of another dynamic query can be a very powerful tool (yes, the results stay dynamic, not static). And you can keep going down an almost infinite number of "layers" (though with each layer you take a hit in performance, so you wouldn't want a really complex set used in a self-refreshing Dashboard).
0
Categories
- All Categories
- Shannon parent
- shannon 2
- shannon 1
- 21 Advocacy DC Users Group
- 14 BBCRM PAG Discussions
- 89 High Education Program Advisory Group (HE PAG)
- 28 Luminate CRM DC Users Group
- 8 DC Luminate CRM Users Group
- Luminate PAG
- 5.9K Blackbaud Altru®
- 58 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 409 bbcon®
- 2.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- donorCentrics®
- 1.1K Blackbaud eTapestry®
- 2.8K Blackbaud Financial Edge NXT®
- 1.1K Blackbaud Grantmaking™
- 527 Education Management Solutions for Higher Education
- 1 JustGiving® from Blackbaud®
- 4.6K Education Management Solutions for K-12 Schools
- Blackbaud Luminate Online & Blackbaud TeamRaiser
- 16.4K Blackbaud Raiser's Edge NXT®
- 4.1K SKY Developer
- 547 ResearchPoint™
- 151 Blackbaud Tuition Management™
- 1 YourCause® from Blackbaud®
- 61 everydayhero
- 3 Campaign Ideas
- 58 General Discussion
- 115 Blackbaud ID
- 87 K-12 Blackbaud ID
- 6 Admin Console
- 949 Organizational Best Practices
- 353 The Tap (Just for Fun)
- 235 Blackbaud Community Feedback Forum
- 55 Admissions Event Management EAP
- 18 MobilePay Terminal + BBID Canada EAP
- 36 EAP for New Email Campaigns Experience in Blackbaud Luminate Online®
- 109 EAP for 360 Student Profile in Blackbaud Student Information System
- 41 EAP for Assessment Builder in Blackbaud Learning Management System™
- 9 Technical Preview for SKY API for Blackbaud CRM™ and Blackbaud Altru®
- 55 Community Advisory Group
- 46 Blackbaud Community Ideas
- 26 Blackbaud Community Challenges
- 7 Security Testing Forum
- 1.1K ARCHIVED FORUMS | Inactive and/or Completed EAPs
- 3 Blackbaud Staff Discussions
- 7.7K ARCHIVED FORUM CATEGORY [ID 304]
- 1 Blackbaud Partners Discussions
- 1 Blackbaud Giving Search™
- 35 EAP Student Assignment Details and Assignment Center
- 39 EAP Core - Roles and Tasks
- 59 Blackbaud Community All-Stars Discussions
- 20 Blackbaud Raiser's Edge NXT® Online Giving EAP
- Diocesan Blackbaud Raiser’s Edge NXT® User’s Group
- 2 Blackbaud Consultant’s Community
- 43 End of Term Grade Entry EAP
- 92 EAP for Query in Blackbaud Raiser's Edge NXT®
- 38 Standard Reports for Blackbaud Raiser's Edge NXT® EAP
- 12 Payments Assistant for Blackbaud Financial Edge NXT® EAP
- 6 Ask an All Star (Austen Brown)
- 8 Ask an All-Star Alex Wong (Blackbaud Raiser's Edge NXT®)
- 1 Ask an All-Star Alex Wong (Blackbaud Financial Edge NXT®)
- 6 Ask an All-Star (Christine Robertson)
- 21 Ask an Expert (Anthony Gallo)
- Blackbaud Francophone Group
- 22 Ask an Expert (David Springer)
- 4 Raiser's Edge NXT PowerUp Challenge #1 (Query)
- 6 Ask an All-Star Sunshine Reinken Watson and Carlene Johnson
- 4 Raiser's Edge NXT PowerUp Challenge: Events
- 14 Ask an All-Star (Elizabeth Johnson)
- 7 Ask an Expert (Stephen Churchill)
- 2025 ARCHIVED FORUM POSTS
- 322 ARCHIVED | Financial Edge® Tips and Tricks
- 164 ARCHIVED | Raiser's Edge® Blog
- 300 ARCHIVED | Raiser's Edge® Blog
- 441 ARCHIVED | Blackbaud Altru® Tips and Tricks
- 66 ARCHIVED | Blackbaud NetCommunity™ Blog
- 211 ARCHIVED | Blackbaud Target Analytics® Tips and Tricks
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- Luminate CRM DC Users Group
- 225 ARCHIVED | Blackbaud eTapestry® Tips and Tricks
- 1 Blackbaud eTapestry® Know How Blog
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
- 1 Blackbaud K-12 Education Solutions™ Blog
- 280 ARCHIVED | Mixed Community Announcements
- 3 ARCHIVED | Blackbaud Corporations™ & Blackbaud Foundations™ Hosting Status
- 1 npEngage
- 24 ARCHIVED | K-12 Announcements
- 15 ARCHIVED | FIMS Host*Net Hosting Status
- 23 ARCHIVED | Blackbaud Outcomes & Online Applications (IGAM) Hosting Status
- 22 ARCHIVED | Blackbaud DonorCentral Hosting Status
- 14 ARCHIVED | Blackbaud Grantmaking™ UK Hosting Status
- 117 ARCHIVED | Blackbaud CRM™ and Blackbaud Internet Solutions™ Announcements
- 50 Blackbaud NetCommunity™ Blog
- 169 ARCHIVED | Blackbaud Grantmaking™ Tips and Tricks
- Advocacy DC Users Group
- 718 Community News
- Blackbaud Altru® Hosting Status
- 104 ARCHIVED | Member Spotlight
- 145 ARCHIVED | Hosting Blog
- 149 JustGiving® from Blackbaud® Blog
- 97 ARCHIVED | bbcon® Blogs
- 19 ARCHIVED | Blackbaud Luminate CRM™ Announcements
- 161 Luminate Advocacy News
- 187 Organizational Best Practices Blog
- 67 everydayhero Blog
- 52 Blackbaud SKY® Reporting Announcements
- 17 ARCHIVED | Blackbaud SKY® Reporting for K-12 Announcements
- 3 Luminate Online Product Advisory Group (LO PAG)
- 81 ARCHIVED | JustGiving® from Blackbaud® Tips and Tricks
- 1 ARCHIVED | K-12 Conference Blog
- Blackbaud Church Management™ Announcements
- ARCHIVED | Blackbaud Award Management™ and Blackbaud Stewardship Management™ Announcements
- 1 Blackbaud Peer-to-Peer Fundraising™, Powered by JustGiving® Blogs
- 39 Tips, Tricks, and Timesavers!
- 56 Blackbaud Church Management™ Resources
- 154 Blackbaud Church Management™ Announcements
- 1 ARCHIVED | Blackbaud Church Management™ Tips and Tricks
- 11 ARCHIVED | Blackbaud Higher Education Solutions™ Announcements
- 7 ARCHIVED | Blackbaud Guided Fundraising™ Blog
- 2 Blackbaud Fundraiser Performance Management™ Blog
- 9 Foundations Events and Content
- 14 ARCHIVED | Blog Posts
- 2 ARCHIVED | Blackbaud FIMS™ Announcement and Tips
- 59 Blackbaud Partner Announcements
- 10 ARCHIVED | Blackbaud Impact Edge™ EAP Blogs
- 1 Community Help Blogs
- Diocesan Blackbaud Raiser’s Edge NXT® Users' Group
- Blackbaud Consultant’s Community
- Blackbaud Francophone Group
- 1 BLOG ARCHIVE CATEGORY
- Blackbaud Community™ Discussions
- 8.3K Blackbaud Luminate Online® & Blackbaud TeamRaiser® Discussions
- 5.7K Jobs Board