From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: Help with org-lookup-all Date: Wed, 03 Sep 2014 16:18:58 +1000 Message-ID: <5406B2D2.1050103@gmail.com> References: <54066DD0.60608@gmail.com> <87y4u1l2g7.fsf@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP3uO-0004bG-Jk for emacs-orgmode@gnu.org; Wed, 03 Sep 2014 02:19:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP3uJ-0000FE-Mn for emacs-orgmode@gnu.org; Wed, 03 Sep 2014 02:19:08 -0400 Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]:35412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP3uJ-0000F4-Fj for emacs-orgmode@gnu.org; Wed, 03 Sep 2014 02:19:03 -0400 Received: by mail-pd0-f181.google.com with SMTP id fp1so10398071pdb.40 for ; Tue, 02 Sep 2014 23:19:02 -0700 (PDT) Received: from [192.168.1.1] (202.63.32.163.static.rev.eftel.com. [202.63.32.163]) by mx.google.com with ESMTPSA id ha10sm5826896pbd.49.2014.09.02.23.18.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Sep 2014 23:19:01 -0700 (PDT) In-Reply-To: <87y4u1l2g7.fsf@alphaville.dokosmarshall.org> 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 On 03/09/14 15:04, Nick Dokos wrote: > Alan L Tyree writes: > >> I feel so dumb! >> >> I have this expession attached to a table: (org-lookup-all $1 >> '(remote(payments,@2$4..@>$4)) '(remote(payments,@2$2..@>$2))) >> >> It is returning the right list of numbers since I can examine them >> with (nth n .... >> >> How do I add the list up? I keep getting #ERROR or obviously wrong >> answers. What I want is something like >> >> $2='(apply '+ (org-lookup-all $1 '(remote(payments,@2$4..@>$4)) >> '(remote(payments,@2$2..@>$2)))) >> >> but that gives me errors since (I presume) the list is a bunch of strings. >> > If they *are* a bunch of strings, then mapping string-to-number across the > list should do the trick: > > > $2='(apply '+ (mapcar (function string-to-number) (org-lookup-all $1 '(remote(payments,@2$4..@>$4)) '(remote(payments,@2$2..@>$2))))) > That worked a treat - thanks Nick. Cheers, Alan -- Alan L Tyree http://www2.austlii.edu.au/~alan Tel: 04 2748 6206 sip:typhoon@iptel.org