org-clock-sum gets the time logged for a header and all of its children. Is there a way to get the time logged ONLY for the top level header (but not its children?).

1 Answer 1


If by top level header you mean the outline level 1:

(org-clock-sum nil nil (lambda ()
                         (= (org-outline-level) 1)))


  (let ((level (org-outline-level)))
    (org-clock-sum nil nil (lambda ()
                             (= (org-outline-level) level)))))

See the third argument of the org-clock-sum function:

Headlines for which HEADLINE-FILTER returns nil are excluded from the clock summation.

Your Answer

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

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