Smart Groups of items with (only) one tag?

I’m storing items in Groups, with each item having at least one – but sometimes more – tags.

I’ve created SmartGroups under each Group to filter based on tag combinations: Tag A AND Tag B, Tag A AND Tag C AND Tag D, etc.

I can see how to create a Smart Group where the Item IS NOT tagged, or where the Item IS tagged, but neither of these is exactly what I am now wanting.

What I want is to also create a SmartGroup for Items in the main Group which have only (exactly) one Tag. In other words, I want (somehow) to be able to count the tags an Item has and to select all where this count is exactly equal to 1.

Is this possible?

I don’t think you could do that with a Smart Group with “Tag” – or any other predicate for that matter. But, I also don’t grasp why you would want to do that :confused: Could you discuss the rationale a bit more? Perhaps there is another approach.

I’m trying to smart filter items relating to various rental properties. These items are all tagged with the property name (Mayfair, Park Street, etc) and items may also have added tags (Land tax, Rental Statement, Repairs, etc). Some items are tagged with the property name (only).

The items are all stored in Groups (one for each property – Mayfair, Park Street etc). Under each of these Groups I have Smart Groups (Land tax, Rental Statement, Repairs, etc). These are automatically populated (Tags Mayfair AND Land Tax, Mayfair AND Repairs etc).

I’m trying to also have a Smart Group for unclassified items (Tag Mayfair AND NOT (Land tax, Rental Statement, Repairs, etc). I can do this by manually defining the AND and AND NOT tags for each item, but this becomes very tedious when the (Land tax, Rental Statement, Repairs, etc). list is very large or when new tags are added to that list afterwards.

What I was trying instead to do is to set unclassified items as (Tag Mayfair AND no other tags) or (Tag Mayfair AND tag count = 1).

I hope this makes sense.

You want to find items that are contained in a given group (i.e., that are related to a specific property) but are not tagged?

Perhaps this would help

Note, that the “Search In:” box is targeted to a specific group (“Boardwalk”). So, do not place the smart group as a child of “Boardwalk”. Also the predicate should be looking for untagged items – the “*” is a wildcard not a tag, although there seems to be an (at least cosmetic) bug in DEVONthink 2.5.2 that makes wildcards look like tags. This particular smart group works over here on test data, but you’d need to try it with real data, of course.

(Note for others: because the smart group editor accepts wildcards when looking for tags, it is not a good idea to have tags with names that look like wildcards.)

korm has given you an excellent solution, and here is another option that may meet your needs as well. I’m assuming that all the property tags (i.e. Mayfair) are (gray) Group tags and that all the additional tags (Land tax, Repairs, etc.) are regular (blue) Tags? If that is the case, then you can temporarily turn off Group tags via the ‘File>Database Properties…’ command…

and then create a smart group that searches for all documents without tags.

Once you have worked with the items in this smart group, re-enable your Group tags by reversing the first step. The advantage that this approach gives you is that you need only one smart group to work with the entire database. However, if you have additional Group tags then korm’s approach is the way to go.

AMEN, korm! It is always best to observe appropriate naming conventions paying careful attention to using cross-platform acceptable characters ie. without having to escape characters)

My rule: Punctuation is for sentences, not filenames. 8)

Thanks everyone for the suggestions. The solution suggested by korm fits my needs best, so I will adapt it for my use.