I would like to create a table where one column contains a range of week numbers and another contains the clocked file time for each of those weeks. The latter column should be filled automatically using a table formula. Therefore, whatever functions the table formula requires should be side-effect-free (i.e. not mess with my buffer, only return the clocked time). I've looked at a few org-clock-* functions but my Emacs-Lisp is not impressive and I can't seem to be able to find a sane way to do this.
In the following example I added the file times manually. What I'm asking for is a table formula in Emacs-Lisp that computes the column File Time automatically.
* Work :LOGBOOK: CLOCK: [2024-01-01 Mon 09:00]--[2024-01-01 Mon 17:30] => 8:30 CLOCK: [2024-01-08 Mon 09:00]--[2024-01-08 Mon 16:30] => 7:30 CLOCK: [2024-01-09 Tue 09:00]--[2024-01-09 Tue 17:00] => 8:00 CLOCK: [2024-01-22 Mon 09:00]--[2024-01-22 Mon 16:00] => 7:00 :END: * Time Sheet | Calendar Week | File Time | |---------------+-----------| | 1 | 08:30 | | 2 | 15:30 | | 3 | 00:00 | | 4 | 07:00 | #+TBLFM: $1=@# - 1
org-clock-displaybut non-interactive and taking a week number as an argument.