How to sort by two keys simultaneously?

[Found none discussions of this kind, please refer me to, if a one exists.]

I need to sort by two keys simultaneously.
Namely: if the author is missing, the title should perform the role of the key.

For instance: [consider #14 here]
13. Ekman P. Basic Emotions. Handbook of .....
14. El misterio de la macabra - Barbara Hannigan y la Sinfónica de Londres. URL: https://www........
15. Engel J., Astbury B., Keast H. et al. What is ......

so, #13 & #15 possess an author whilst #14 doesn't.
At the moment I'm having sorting either by an author or by the title, not by both, so, either "El misterio..." goes to the end or to the front.

Any ideas?
  • Include title in the “substitute” section of the “names” call for authors. Take a look at APA for an example.
  • [found a solution]

    CSL has sorting by macro solution,
    so in my case it's creating a macro, then a conditional:
    >if author exists, sort by author,
    >else, sort by the title
Sign In or Register to comment.