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) »
  • Searching by Tags Quandry
Pages: [1]

Author Topic: Searching by Tags Quandry  (Read 1085 times)

FredJones

  • Guest
Searching by Tags Quandry
April 28, 2008, 04:57:22 am
Using Drupal 5 and CiviCRM 1.9.11960

If I just click on Search it says "Found 8595 contacts" So this is my total # of contacts.

I want to make a list of members of groups ABCDEF and then a list of all OTHER contacts.

So I made a smart group called "Mailer/Clients/Volunteers" and when I search on it I see:

Code: [Select]
Mailer/Clients/Volunteers (smart group) - Found 494 group members

    * Member of Group IN Mailer/Clients/Volunteers   ... AND ...
    * Group Status - "Added"

When I edit group criteria I see:

Code: [Select]
Mailer/Clients/Volunteers (smart group) - Found 494 group members

    * Member of Group IN Evening Mailing or Hotline Volunteers or Retreat Client or Tomechet Client or Tomechet North or Tomechet South   ... AND ...
    * Group Status - "Added"

which appears correct--those are my six groups.

Then I made another smart group like this:

Code: [Select]
NOT Mailer/Clients/Volunteers (smart group) - Found 8467 group members

    * Member of Group IN NOT Mailer/Clients/Volunteers   ... AND ...
    * Group Status - "Added"

When I edit group criteria I see:

Code: [Select]
NOT Mailer/Clients/Volunteers (smart group) - Found 8467 group members

    * Member of Group != Mailer/Clients/Volunteers   ... AND ...
    * Group Status - "Added"   ... AND ...
    * Contact Type - 'Individual'

which also seems correct. But 8467 and 494 is 8961 and I only have 8595 contacts so I have duplicates. :(

So then I made a search with the Search Builder like this:

Code: [Select]
Found 8337 contacts

    * Member of Group != Hotline Volunteers   ... AND ...
    * Group Status - "Added"   ... AND ...
    * Member of Group != Evening Mailing   ... AND ...
    * Group Status - "Added"   ... AND ...
    * Member of Group != Retreat Client   ... AND ...
    * Group Status - "Added"   ... AND ...
    * Member of Group != Tomechet Client   ... AND ...
    * Group Status - "Added"   ... AND ...
    * Member of Group != Tomechet North   ... AND ...
    * Group Status - "Added"   ... AND ...
    * Member of Group != Tomechet South   ... AND ...
    * Group Status - "Added"   ... AND ...
    * Contact Type - 'Individual'

This should recreate the "NOT Mailer/Clients/Volunteers" and show all contacts which are NOT in groups ABCE or F. Now I am indeed getting fewer contacts (8337 instead of 8467 for "NOT Mailer/Clients/Volunteers") but still the total is 8337 + 494 = 8831 which is more than my total of 8595 contacts.

Can someone point out what I am doing wrong here?

I basically want to get two lists--one of ABCDEF members and one list of everyone else.

Thanks.

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: Searching by Tags Quandry
April 28, 2008, 12:09:44 pm

I think the main issue is SQL semantics != set semantics (which u are after)

A easy way to accomplish what u r after:

1. Tag all contact with OTHER
2. Search for contacts tagged ABCDEF
3. Remove tag OTHER from this this group

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

FredJones

  • Guest
Re: Searching by Tags Quandry
April 29, 2008, 12:41:08 am
Your solution worked perfectly (of course).

Thank you very much!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Searching by Tags Quandry

This forum was archived on 2017-11-26.