Category Counting

Started by PaulS, February 19, 2018, 02:05:47 AM

Previous topic - Next topic

PaulS

In a post last year, Mario offered a variable construct which could be used to create a data-driven category that counts the number of assignments in a category.  In my case it looks like this:

  {File.Categories.Direct|filter:^Subject\|People;count:true}

According to Help, "The Direct variable only returns the categories to which the file is directly assigned; it ignores data-driven categories and formulas."  This is almost perfect for me, however, it does not exclude Alias categories.  Example:

  A picture contains only one person, Louise Smith.
  This picture has only one directly assigned category, Subject|People|Family|Grandparents|Louise which has an Alias category, Subject|People|Smith|Louise.
  The above variable will return 2 instead of 1.

Is there a way also to exclude Alias categories from the count?

If it is possible, then it would work perfectly for me to replace an IM5 script that counts categories and writes the results to attributes.  This is the only remaining script for which I need to find alternative so that I can make the transition from IM5 to IM2017 and leave VBScript behind.

Thanks.

Mario

This is not possible. Alias categories are considered as normal categories, except for the process or assigning or removing files. This has to work that way to make all the category magic work. For the Direct formula a file looks to be directly assigned whether it looks at the Alias or the original category. And this has to be that way, because if you would query the section of your category hierarchy which includes the Alias category, you (or other users) would expect the file to be counted.

I would need to think about this to figure out the consequences of changing this behavior, which is in place for over four years now. Category variables are technically challenging, as it is.

I suggest you create a feature request in the feature request board so this is not forgotten and other users can comment.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

PaulS

Thanks for the reply Mario.  I'll think about it a bit and may put in a feature request.

sinus

Quote from: PaulS on February 20, 2018, 02:32:56 AM
Thanks for the reply Mario.  I'll think about it a bit and may put in a feature request.

Paul, you have seen, that the real count is there in the "count-view" - see my attachement.
Is this not enough for you?
Best wishes from Switzerland! :-)
Markus

axel.hennig

@PaulS: I've got the same "problem" and I would "+1" such a feature request.

@sinus: I think this is not a solution to the problem. The red "1" you marked in your screenshot is just the number of images assigned to category "2". But: Since Louise is the only person in the people-tree, this picture should be assigned to the DD-category "1" and not "2".

sinus

Thanks, Axel,
I know, wanted only to be sure, that Paul knows this (counting, what you can enable or not) also.

I see the problem.
Best wishes from Switzerland! :-)
Markus

PaulS

#6
Thanks for the suggestion Markus.  Axel is right, this won't do what I need.

So I have added a feature request related to this topic:  https://www.photools.com/community/index.php?topic=7799.0