Search code examples
emacsorg-mode

org-mode clock table by tag


In Emacs org-mode, is it possible to have the clock report table show how much time has been spent on each tag? The manual seems to think so, but I can't make it work. This is what I have tried:

#+BEGIN: clocktable :maxlevel 2 :scope file :tags nicetag

#+END:

* Header one :nicetag:
:LOGBOOK:  
CLOCK: [2016-07-23 Sat 18:24]--[2016-07-23 Sat 19:38] =>  1:14
CLOCK: [2016-07-23 Sat 12:23]--[2016-07-23 Sat 13:43] =>  1:20
:END:      
* Another header :bigtag:
:LOGBOOK:  
CLOCK: [2016-07-23 Sat 20:24]--[2016-07-23 Sat 20:34] =>  0:10
:END:
* A task  :nicetag:
:LOGBOOK:  
CLOCK: [2016-07-23 Sat 10:26]--[2016-07-23 Sat 11:26] =>  1:00
:END:      

What I would like is for the table to show the time taken on all the headers with tag :nicetag:, but the table doesn't show anything. Even better would be a way to make the table show the time spent on each tag in the file.


Solution

  • Do you mean?

    #+BEGIN: clocktable :maxlevel 2 :scope file :tags "nicetag"
    

    (Note the "" around your tag.) The error message shown in the echo area when you try to use it without "" is "Wrong type argument: stringp, nicetag", which means that Emacs expected to read a string but got something that wasn't. Hope that helps!