photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: bonsai on April 04, 2016, 09:49:56 PM

Title: Sort by category
Post by: bonsai on April 04, 2016, 09:49:56 PM
Sorry, I'm too blind to find a solution.
I want to show images of one category (in a category or a filter) sorted by another category.
All I found is to sort by tags or attributes but not by categories.
I set up a category with a formula "Cat1 AND Cat2" and wanted to sort by Cat1 alphabetically.
What am I doing wrong? :-[
Thanks in advance
Title: Re: Sort by category
Post by: Mario on April 05, 2016, 08:10:28 AM
IMatch cannot sort by individual categories. IMatch can only sort by all categories a file is assigned to.
When you add the Categories attribute to one of your sort profiles, IMatch does the following: It gets the full name of all categories the file is assigned to, and then sorts these category names alphabetically. It does this for all files to sort, and then sorts the files after the resulting string. This ensures a reliable and reproducible sort sequence, independent from how many categories the files to sort are assigned to.

Think about why you want to sort the files by this specific category, and then use one of the many other ways to sort files, e.g. give all the files in that category a specific attribute, assign a collection or similar. If you, for example, give all files in that category a dot or a pin, you can easily sort them.
Title: Re: Sort by category
Post by: Carlo Didier on April 05, 2016, 10:09:40 AM
Quote from: bonsai on April 04, 2016, 09:49:56 PMI set up a category with a formula "Cat1 AND Cat2" and wanted to sort by Cat1 alphabetically

I don't quite understand what you want to accomplish? If you selected files by a formula like "Houses AND Blue", you will get all blue houses. There won't be blue cars or blue bridges, etc. So, sorting by the category Houses will accomplish nothing, because there is only one value, or am I missing something?
Title: Re: Sort by category
Post by: bonsai on April 05, 2016, 01:34:43 PM
It was my fault, a bad and wrong explanation and wrong thoughts.
The biggest failure (and thoughts) was not to say that Cat1 is a hierarchical category with a lot of sub-categories, like AAA, AAB, ABA, BAA, BBA and so on. This is just an example to show what I want to do.
I want to show all images with Cat1 and Cat2 assigned sorted alphabetically by the sub-cats of Cat1.

Sorry...
Title: Re: Sort by category
Post by: Mario on April 05, 2016, 02:33:10 PM
Quote...assigned sorted alphabetically by the sub-cats of Cat1.

This is not possible with the sorting features built-in. No way to sort files by one or more sub-categories of another category. Use one of the tips I mentioned above.
Title: Re: Sort by category
Post by: Carlo Didier on April 05, 2016, 04:27:15 PM
Quote from: bonsai on April 05, 2016, 01:34:43 PM
It was my fault, a bad and wrong explanation and wrong thoughts.
The biggest failure (and thoughts) was not to say that Cat1 is a hierarchical category with a lot of sub-categories, like AAA, AAB, ABA, BAA, BBA and so on. This is just an example to show what I want to do.
I want to show all images with Cat1 and Cat2 assigned sorted alphabetically by the sub-cats of Cat1.

Sorry...

Ah, ok. A workaround might be to go to the categories view on Cat1 and filter for files in Cat2 from there.
Title: Re: Sort by category
Post by: bonsai on April 05, 2016, 06:03:51 PM
Thanks Carlo, but also in this way the files are not shown in alphabetically order.

I wonder how I should solve this problem with dots and pins...
Had a look at variables but I didn't found an easy way for a solution.
The only thing I can think of is a script, but that's where my challenge begins ::)
Title: Re: Sort by category
Post by: Carlo Didier on April 06, 2016, 07:34:45 AM
I don't think pins or dots can help you here.
As Mario suggested, you'd have to add the subcategories to attributes for each file (could be done with a script or a template) and then sort on that.
Title: Re: Sort by category
Post by: sinus on April 06, 2016, 08:24:51 AM
Sorry, I do still not understand ... lack of my English.

At least to sort files in IMatch you have several possibilities.
For example:

-simply change the filename (subcat A: A-xxx, subcat B: B-xxx)

-use a metadata-field for this: with a metadata-template (or script) do numbering an empty field, simply increasing or each sub-cat like above with a letter or word ahead of the number. And than simply sort by this field. I do this often for several reasons.

my 2 cents.
Title: Re: Sort by category
Post by: bonsai on April 06, 2016, 08:26:50 AM
Yes Carlo, that's what I mentioned above.
I haven't a clue about scripts but template sounds interesting.
The data is there (the subcats) and I don't want to enter an attribute for each file by hand.
I'll go through the helpfile to find out more...
Thanks anyway :)
Title: Re: Sort by category
Post by: bonsai on April 06, 2016, 08:33:22 AM
@Markus

The (sub)cats are not static, they are growing every day.
I'll look into templates, maybe this will give me a solution.
Thank you
Title: Re: Sort by category
Post by: Carlo Didier on April 06, 2016, 08:52:10 AM
Quote from: sinus on April 06, 2016, 08:24:51 AM
Sorry, I do still not understand ... lack of my English.

At least to sort files in IMatch you have several possibilities.
For example:

-simply change the filename (subcat A: A-xxx, subcat B: B-xxx)

-use a metadata-field for this: with a metadata-template (or script) do numbering an empty field, simply increasing or each sub-cat like above with a letter or word ahead of the number. And than simply sort by this field. I do this often for several reasons.

my 2 cents.

Renaming and changing metadata has side effects that must be considered: renaming and writing metadata to files changes the files and hence triggers backups for example, which isn't necessary. That's why I suggested attributes.
Title: Re: Sort by category
Post by: sinus on April 06, 2016, 09:27:37 AM
Quote from: Carlo Didier on April 06, 2016, 08:52:10 AM
Quote from: sinus on April 06, 2016, 08:24:51 AM
Sorry, I do still not understand ... lack of my English.

At least to sort files in IMatch you have several possibilities.
For example:

-simply change the filename (subcat A: A-xxx, subcat B: B-xxx)

-use a metadata-field for this: with a metadata-template (or script) do numbering an empty field, simply increasing or each sub-cat like above with a letter or word ahead of the number. And than simply sort by this field. I do this often for several reasons.

my 2 cents.

Renaming and changing metadata has side effects that must be considered: renaming and writing metadata to files changes the files and hence triggers backups for example, which isn't necessary. That's why I suggested attributes.

Yes, Carlo, you are right.
Attributes are fine for this.

Though I do this often, but do not write-back the metadatas.