Find files which have a value in tag A but not in B

Started by Mario, August 25, 2022, 10:43:59 AM

Previous topic - Next topic

Mario

This recently came up in a thread:

"I usually add the city name both in the City tag and in the hierarchical keywords tag.
How can I find files which don't have a keyword matching the city name?"

One trick I've often used was to create a variable which returns YES/NO, depending on whether the condition I'm interested in is met or not.
In your case, this variable would suffice:

{File.MD.hierarchicalkeywords|contains:{File.MD.city},YES,NO,true}

It returns YES when the city value is also contained in the hierarchical keywords, else NO.
Use this to setup a data-driven category and you see all files with mismatches in the NO category.

Tips:

When you use IMatch Locations, IMatch can optionally create keywords when you apply a location.
You can also make IMatch automatically add keywords when you use Reverse Geocoding, see Create keywords from this expression
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook