From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Help with org-lookup-all Date: Wed, 03 Sep 2014 01:04:24 -0400 Message-ID: <87y4u1l2g7.fsf@alphaville.dokosmarshall.org> References: <54066DD0.60608@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP2kR-0000Ex-1A for emacs-orgmode@gnu.org; Wed, 03 Sep 2014 01:04:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP2kJ-0001JZ-JC for emacs-orgmode@gnu.org; Wed, 03 Sep 2014 01:04:46 -0400 Received: from plane.gmane.org ([80.91.229.3]:45943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP2kJ-0001JV-De for emacs-orgmode@gnu.org; Wed, 03 Sep 2014 01:04:39 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XP2kI-0007jD-QG for emacs-orgmode@gnu.org; Wed, 03 Sep 2014 07:04:38 +0200 Received: from pool-108-20-41-17.bstnma.fios.verizon.net ([108.20.41.17]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Sep 2014 07:04:38 +0200 Received: from ndokos by pool-108-20-41-17.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Sep 2014 07:04:38 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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))))) -- Nick