From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rares Vernica Subject: Re: Bug: Table formula does not copy time interval correctly [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.0.94/lisp/org/)] Date: Thu, 07 Jul 2016 21:06:58 -0700 Message-ID: <87vb0gbwnx.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLN4E-0004Xw-37 for emacs-orgmode@gnu.org; Fri, 08 Jul 2016 00:07:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLN49-0001xZ-Ti for emacs-orgmode@gnu.org; Fri, 08 Jul 2016 00:07:05 -0400 Received: from mail-oi0-x22c.google.com ([2607:f8b0:4003:c06::22c]:36679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLN49-0001xB-Nl for emacs-orgmode@gnu.org; Fri, 08 Jul 2016 00:07:01 -0400 Received: by mail-oi0-x22c.google.com with SMTP id f189so50461004oig.3 for ; Thu, 07 Jul 2016 21:07:01 -0700 (PDT) In-Reply-To: (Michael Brand's message of "Thu, 7 Jul 2016 08:52:36 +0200") 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" To: Michael Brand Cc: Org Mode Michael Brand writes: > Hi Rares > > On Mon, Jul 4, 2016 at 6:28 PM, Rares Vernica wrote: > >> | [2016-07-03 Sun]--[2016-07-04 Mon] | 1d | d | >> | [2016-07-03 Sun]--[2016-07-05 Tue] | 2d | 2 d | >> #+TBLFM: $3=$2 > > A Calc formula interprets field values as a symbolic expressions to > calculate with. To copy literally one needs a Lisp formula: > > | [2016-07-03 Sun]--[2016-07-04 Mon] | 1d | 1d | > | [2016-07-03 Sun]--[2016-07-05 Tue] | 2d | 2d | > > #+TBLFM: $3 = '(identity $2) That did the trick, thanks! Just to clarify, how would you fix this: | [2016-07-05 Tue]--[2016-07-06 Wed] | 1d | vsum(d) | | [2016-07-06 Wed]--[2016-07-07 Thu] | 1d | 2 d | #+TBLFM: $3=vsum(@1$-1..@0$-1) Notice the "vsum(d)" instead of the expected "1 d". How would you add "identity" here? Thanks! Rares