5

I've been tracking my work time in org-mode for several years. My normal practice is to use clocktable mode in the agenda for daily tracking, and a clocktable block in my main projects file for monthly tracking. Both of these give me sums of my work time by file hierarchy, which in my org files corresponds to areas of responsibility and projects.

This is great, but now I need to be able to track time in this way, but also by type of activity (i.e., how much time on project management tasks, how much time on documentation, how much on customer meetings, etc.). I could tag the particular tasks I work on with tags for type of activity, but is there a way to get summed times (daily or monthly) by tag?

Has anyone had to do this (sum times in two different ways)? If so, what did you do?

2
  • The info manual will probably answer all your questions: (info "(org) The clock table"). There is a :tags and a :block option to filter by tags and time.
    – mutbuerger
    Jul 21, 2016 at 14:13
  • +1 Don't know why this question hasn't been upvoted out the wazoo. I've been trying to figure out how to do exactly this for ages, and came here via another attempt at figuring it out. And since I've had exposure to aspect oriented programming, when I saw "cross-cutting concerns" in my search results, I half expected to that it was simply one of my own questions asked a while ago. So I was glad to find at least one other person asking the same thing!
    – tkp
    Jan 11, 2017 at 12:59

1 Answer 1

5

This is straightforward by using the :tags option in clocktable lines, and I use this to do something similar to you. I have a separate org file (clock.org in my case), which just contains clock tables with various time and project-specific tag filters. I then refresh the tables in this file when it comes time to pluck numbers out for a timesheet or whatever.

For example, the following reports time entries from the previous week that have a tag like "TAF001", "TAF002" etc (for time on change requests, in my case). This also includes an additional "TAGS" column so I can see which tags were on which item.

The :tags option takes a regular expression, so I make sure to include ^ to avoid incorrect matches if somehow the expression matches within a tag:

#+BEGIN: clocktable :maxlevel 7 :scope agenda :block lastweek :fileskip0 :formatter :link t :indent t :inherit-props t :properties ("TAGS") :tags "-NOCLOCK+{^TAF[0-9]*}" :narrow 79 :formula %
#+END:

This also excludes anything tagged "NOCLOCK", and adds a percentage column in addition to reporting the raw time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.