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 on combination of Tags using 'NOT IN' and 'IN' logic
Pages: [1]

Author Topic: Searching on combination of Tags using 'NOT IN' and 'IN' logic  (Read 641 times)

LiteracyVictoria

  • Guest
Searching on combination of Tags using 'NOT IN' and 'IN' logic
October 20, 2010, 12:58:01 pm
Hello:

I work for a non-profit in Victoria BC. I am helping them set up and use CiviCRM. I have set up the necessary groups and tags according to recommended practices. I am trying to configure some smart groups using a combination of tags. One of the tags is searched for based on the positive case of the tag being 'set' or checked and the second case (an AND), I believe, I set to use the negative case, where the tag is not 'set' (is unchecked).

As the individual tags don't show up only a tag(s) item at the bottom I select individual tag(s) IN [id number] (I also tried tag(s) = id number, which did select the records with that tag checked). I assume this returns records where the tag (id=29 in this case) is checked.

What I can't seem to sucessfully do is AND this positive case with a negative case using another tag (in this case id = 28). I tried using the '!=' assuming this was the negative and would return only records where the tag is not checked but the search results didn't exclude the records where this tag was checked as I expected (where tag id = 28 is checked).

It would be nice if there was a 'IS NOT IN' piece here. Or possibly I can search on the ID (Open ID?) and then use 1 or 0 for the return record  criteria.

I have closely reviewed all the documentation and asked our developer but am not sure whether I am dealing with a bug, doing this the wrong way, or this is something that can't be done and I need to reverse the logic of the second tag (id = 28) to get the AND to work the way I want. It seems that advanced searches, for example, only select positive tags case (i.e. records are only returned for cases where the tag checked in the search applet are also checked for the contact records, but doesn't return unchecked tags as positive cases, as in this search context that wouldn't make sense).

I hope this is clear, and thanks for any help you can offer.

Brian, Manager of Operations, Literacy Victoria

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Searching on combination of Tags using 'NOT IN' and 'IN' logic
October 20, 2010, 01:33:58 pm
Hi,
I don't know what version of CiviCRM you are using so this might not be an option for you but I'll post it anyway, just in case it will help you.

In version 3.1.3:
Click on Search and select "Custom Searches"
Select "Include/Exclude Contacts in a Group/Tag"

Select the tags to include/exclude, do the search and create a new smart group with the found set. If this works for you be sure to test it for additions/deletions to the smart group.

Hope this helps,
Cynthia

you might want to update your profile with the version of civicrm etc... you are using as it is helpful to those who might want to help you

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Searching on combination of Tags using 'NOT IN' and 'IN' logic

This forum was archived on 2017-11-26.