How can you sort the Org clock table?

Here is an example Org clock table in Emacs:

#+BEGIN: clocktable :maxlevel 1 :scope file :tcolumns 1 :formula %
#+CAPTION: Clock summary at [2014-03-30 Sun 22:47]
| Headline     |   Time |     % |
|--------------+--------+-------|
| *Total time* | *4:31* | 100.0 |
|--------------+--------+-------|
| Item A       |   1:07 |  24.7 |
| Item B       |   1:06 |  24.4 |
| Item C       |   2:18 |  50.9 |
#+TBLFM: $3='(org-clock-time% @2$2 $2..$2);%.1f
#+END:

I want to sort the table by column%. Is it possible?

Here's a more complex example:

#+BEGIN: clocktable :maxlevel 2 :scope file :tcolumns 1 :formula %
#+CAPTION: Clock summary at [2014-03-30 Sun 22:48]
| Headline           |   Time |     % |
|--------------------+--------+-------|
| *Total time*       | *4:31* | 100.0 |
|--------------------+--------+-------|
| Item A             |   1:07 |  24.7 |
| \__ Item A1        |   0:07 |   2.6 |
| \__ Item A2        |   1:00 |  22.1 |
| Item B             |   1:06 |  24.4 |
| \__ Item B1        |   1:06 |  24.4 |
| Item C             |   2:18 |  50.9 |
| \__ Item C1        |   2:18 |  50.9 |
#+TBLFM: $3='(org-clock-time% @2$2 $2..$2);%.1f
#+END:

In this case, top-level elements should be sorted by their% values, but inside each subtree, secondary-level elements should also be sorted by their% values.

+5
source share
2 answers

Org-mode org-clock.el . org-clocktable-write-default , org-clocktable-defaults. , clocktable " ", http://orgmode.org/manual/The-clock-table.html .

, 3 Mx org-table-sort-lines [n] umeric.

" " - org-clocktable-write-default.

+3

org-clocktable-write-default . , ( ), . , , , , .

0

Source: https://habr.com/ru/post/1534165/


All Articles