Question about filters

Started by frankdarwin, September 13, 2021, 09:37:35 PM

Previous topic - Next topic

frankdarwin

I am trying to create a filter that shows me all images where the City field in the metadata contains a value but the Country field is empty or vice versa.
Somehow I can't find the solution.
Does anyone have an idea?

Tveloso

The standard Location Categories that come with IMatch can do this for you.

You could expand the "Other" category at the Country Level, and the child categories would be all the City Names (Files without a Country, but with a City), or Other (Files with neither a Country, nor a City).  Likewise, the Other Category within each Country, contains Files that have a Country, bot not a City.

But that's a lot of clicking around to gather up all those files, so you could create a Variable-Based Data Driven Category that will combine both conditions.  Given those two data elements, there are four possible Categories that can be created:

  • Both Country and City present
  • Country present, City missing
  • Country missing, City present
  • Both Country and City missing
...and you would only need to look in three categories for the problem files.

I tested that using this expression:

        {File.MD.Composite\MWG-Country\Country\0|default:NoCountry;hasvalue:Country} - {File.MD.Composite\MWG-City\City\0|default:NoCity;hasvalue:City}

       

...and wound up with three of the four possible categories:

       

(I clearly have a lot of Geo-coding work to still do in IMatch)...

Mario tells us that Variable-based Categories are very slow though, so you should be aware of that...(and maybe keep them inside a parent category that can be collapsed)...
--Tony

Mario

Keep in mind that variable-based categories are the worst-case, performance-wise.
Make them manual update only, else performance of IMatch may suffer considerably. See the help for details.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

thrinn

You can also use the Filter Panel. Combine a Value Filter on City and the setting "Files with value" and a second Value Filter on Country, also with the setting "Files with value", but with "Invert result" checked. This should result in all files where City is filled, but Country is not filled.
Thorsten
Win 10 / 64, IMatch 2018, IMA