References order

I use “by order of occurrence” to sort my references in an article (full references in the end bibliography, number in brackets in the article). Sometimes, several references are given at the same position in the text. I would find it very useful to have a tool that allows me to automatically sort the references that appear at the same position by a “secondary class ordering”, for example by year of publishing.

Citation ordering can be sorted independently of appearance.  There is a sort option in the citation settings in the output styles, which can be ‘Same as bibliography’ or ‘don’t sort’ which presumably just lists them in the order you inserted them, or Year + Author, or a number of other options, or you can customize the order.  

is that what you are looking for?  

I would like citations in the text and in the bibliography to be ordered chronologically in order of occurrence. Only when several appear at exactly the same position in the text, it would be nice if this subset could automatically be ordered by year of publishing (in the bibliography, and the numbers adjusted in the text, accordingly).

Precisely, so bibliography is still “order of appearance”  and the citation setting is year, author (or what ever you choose).  

See attached Numbered citesort - where I changed the citation sorted changes.  The apearance criteria is applied – but when a group citation is used, those are sorted by year and then author within the group, as long as they haven’t been used before.  I guess the only glitch is if you now use those already numbered and add a new citation that is older, it comes up first in the group  [50, 6, 9, 12]  where 6-12 were used as a group previously. Is that okay?  
Numbered citesort.ens (15.9 KB)

It is true that reciting a chronologically older reference causes a problem, as all numbers inside square brackets should go from smaller to larger. Thank you very much for your help.