How can you sort an Org clock table?

The time clocking code for Org-mode org-clock.el doesn't support any sorting facilities. The function org-clocktable-write-default creates tables by very rigid algorithm with limited variants of tuning, all of them are in the variable org-clocktable-defaults. Thus, dynamic block clocktable generates org tables "as is", http://orgmode.org/manual/The-clock-table.html contains exhaustive list of settings.

You can sort first table manually by placing the cursor in the 3 column and executing M-x org-table-sort-lines [n]umeric.

As to sorting second table with "knowledge about structure of levels" - it seems to be impossible without profound changes in the function org-clocktable-write-default.

Tags:

Emacs

Org Mode