photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: frankdarwin on September 13, 2021, 09:37:35 PM

Title: Question about filters
Post by: frankdarwin on September 13, 2021, 09:37:35 PM
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?
Title: Re: Question about filters
Post by: Tveloso on September 13, 2021, 10:27:12 PM
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:
...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}

        (https://www.photools.com/community/index.php?action=dlattach;topic=11750.0;attach=27978)

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

        (https://www.photools.com/community/index.php?action=dlattach;topic=11750.0;attach=27980)

(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)...
Title: Re: Question about filters
Post by: Mario on September 13, 2021, 10:36:59 PM
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.
Title: Re: Question about filters
Post by: thrinn on September 14, 2021, 08:38:21 AM
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.