CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Advanced searching on NOT...
Pages: [1]

Author Topic: Advanced searching on NOT...  (Read 1170 times)

mlampard

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
Advanced searching on NOT...
September 16, 2010, 11:28:56 am
My client has asked for a few simple searches that look like I might have to write custom searches for, but before I do that I thought I'd ask the question on the forum, in case I'm missing some fundamental way to do this:

1. Need to list all contacts who have donated (contributed), who are NOT members (and/or who have never been members)
2. All contacts who are members who have NOT contributed ever
3. All contacts who are either current members OR who have contributed this year

The advanced search falls short as follows (unless I'm missing something):
1. I cannot "NOT" the member selection
2. I cannot "NOT" the contribution selection
3. This does "Current Member" AND "Contributor this year" - I need "Current Member" OR "Contributor this year"

Any easy way around this, without writing custom searches? My client has just started on the NOT/AND/OR path and I know that they'll be hitting me with more requirements here....

I googled this, but of course google for "civicrm NOT OR AND" produces billions of results  ;)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Advanced searching on NOT...
September 16, 2010, 12:12:52 pm
Don't let me stop you producing some nice Custom Searches but ..
Quote from: mlampard on September 16, 2010, 11:28:56 am
1. Need to list all contacts who have donated (contributed), who are NOT members (and/or who have never been members)
2. All contacts who are members who have NOT contributed ever
3. All contacts who are either current members OR who have contributed this year
You might want to try out the following
Smart Group A = All donors
Smart Group B = All members

Use the existing Custom Search (click on Custom Search under Search) "Include/Exclude Contacts in a Group/Tag"

and I think you can potentially achieve  1 + 2.

For 3 - just select both Smart Groups in Adv Search.

Does that do it?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

mlampard

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
Re: Advanced searching on NOT...
September 16, 2010, 01:04:24 pm
Quote from: peterd on September 16, 2010, 12:12:52 pm

You might want to try out the following
Smart Group A = All donors
Smart Group B = All members

Use the existing Custom Search (click on Custom Search under Search) "Include/Exclude Contacts in a Group/Tag"

and I think you can potentially achieve  1 + 2.

For 3 - just select both Smart Groups in Adv Search.

Does that do it?

I thought of doing that, but the problem is I need greater granularity - contributors this year, last year, this quarter etc etc. Current members, expired members, certain types of members.... the list goes on. The list of smart groups would grow fairly large..... Doable though. It's really a toss up as to whether I create and manage the custom searches or create and manage the smart groups!
Cheers,
Marty.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Advanced searching on NOT...
September 16, 2010, 06:02:21 pm
Marty - You might want to explore extending the SYBUNT report as an alternative since it provides pretty decent options for permutations on contribution patterns. Adding Current Membership filters might not be too hard.
Protect your investment in CiviCRM by  becoming a Member!

mlampard

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
Re: Advanced searching on NOT...
September 17, 2010, 12:47:43 pm
I ended up building custom searches. Am happy to share the searches if anyone's interested:
1. Members who have never contributed
2. Contributors who are not, and have never been, members
3. Current and recently expired members ("recent" expiry date is selected by end user) who have contributed

Thanks for the replies guys.
Cheers,
Marty.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Advanced searching on NOT...
September 17, 2010, 01:10:39 pm
Hi Marty - I think those will be valuable additions to the contributed Custom Searches - maybe add the code to a JIRA ticket so the core team can consider bundling them in??
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Advanced searching on NOT...
September 17, 2010, 02:00:36 pm

marty:

if u can wait for a few days, this would make a great test case for the new civicrm packaging mechanism for custom searches

check:

http://civicrm.org/blogs/michal/civicrm-extensions-framework-taking-33

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mlampard

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
Re: Advanced searching on NOT...
October 16, 2010, 11:15:00 pm
Just a quick update.... I haven't posted these searches, as I'm a little stumped as to why the export function is not working correctly with them (see: http://forum.civicrm.org/index.php/topic,15927.0.html). Once I get this sorted, I can post them.
Cheers,
Marty.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Advanced searching on NOT...

This forum was archived on 2017-11-26.