From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Loris Bennett" Subject: Re: Conditional in table formula with times Date: Fri, 21 Feb 2014 13:56:28 +0100 Message-ID: <8761o8k4jn.fsf@hornfels.zedat.fu-berlin.de> References: <871tywlxci.fsf@hornfels.zedat.fu-berlin.de> <864n3s97e5.fsf@somewhere.org> <87eh2wk5jw.fsf@hornfels.zedat.fu-berlin.de> <86ob207i6o.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGpep-0007sy-O6 for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 07:56:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGpek-0003Vr-CR for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 07:56:47 -0500 Received: from plane.gmane.org ([80.91.229.3]:50517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGpek-0003Vd-5f for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 07:56:42 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WGpei-0007kp-7E for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 13:56:40 +0100 Received: from hornfels.zedat.fu-berlin.de ([160.45.11.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Feb 2014 13:56:40 +0100 Received: from loris.bennett by hornfels.zedat.fu-berlin.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Feb 2014 13:56:40 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org "Sebastien Vauban" writes: > "Loris Bennett" wrote: >> "Sebastien Vauban" writes: >>> "Loris Bennett" wrote: >>>> I'm trying to keep track of total time spend at work, but I am having >>>> trouble with a conditional in table formula: >>>> >>>> | *Day* | *Came* | *Went* | *Worked* | *Required* | *Diff* | >>>> |------------------+--------+--------+----------+------------+----------| >>>> | [2014-01-06 Mon] | 8:00 | 17:00 | 09:00:00 | 00:00:00 | 09:00:00 | >>>> | [2014-01-07 Tue] | | | 00:00:00 | 00:00:00 | 00:00:00 | >>>> | [2014-01-08 Wed] | 8:10 | 16:30 | 08:20:00 | 00:00:00 | 08:20:00 | >>>> | [2014-01-09 Thu] | 7:55 | 17:05 | 09:10:00 | 00:00:00 | 09:10:00 | >>>> | [2014-01-10 Fri] | 8:00 | 17:05 | 09:05:00 | 00:00:00 | 09:05:00 | >>>> #+TBLFM: $4=$3-$2;T::$5=if($4 > 0,"8:18:00","00:00:00");T::$6=$4-$5;T >>>> >>>> Can anyone enlighten me as to why I get "00:00:00" in the first case? >>> >>> Not answering your question... >>> >>> Just wanted to mention that, for this type of task, you probably should >>> have a look at the "clocking" mechanisms (C-c C-x C-i and the like), and >>> use them to generate tables like the above, or bills for clients, etc. >>> >>> Using proper clocking brings you many advantages, whose main (IMO) is >>> the "clock check" feature, where you can check that you don't have >>> unintended clocking gaps during the day, nor clocking overlap... >> >> I do already use clocking for certain areas of activity. However, I >> would need "nested" clocking, i.e. a clock for "at work/not at work" >> which I can clock into at the beginning of the day an out of at the end >> of the day and within that the ability to clock into to and out of >> various activities. Is that possible? > > I do have personal tasks into personal.org, and work tasks in work.org > (and many others). > > Those files have FILETAGS (set to :personal: and :work:) so that I don't > have to manually tag every section, etc. > > Then, in your clocktable, you can include/exclude clock information > based on the tag. > > So, yes, what you ask seems possible to me! OK, so I would clock into a generic ":office:" activity, which might be interrupted by ":programming:", ":bofhing:", ":meeting:", ":lunch:" and ":snooze:". I would then create a clock table including ":office:", ":programming:", ":bofhing:" and ":meeting:", but excluding ":lunch:" and ":snooze:". But would this approach allow me to do stuff like subtracting how long I should have spent at work each day, so that I can work out how much overtime I have? Cheers, Loris -- This signature is currently under construction.