[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Help with org-lookup-all
From: |
Nick Dokos |
Subject: |
Re: [O] Help with org-lookup-all |
Date: |
Wed, 03 Sep 2014 01:04:24 -0400 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) |
Alan L Tyree <address@hidden> 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