[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Spreadsheet - issue with remote reference to named column
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Spreadsheet - issue with remote reference to named column |
Date: |
Thu, 17 Sep 2015 22:05:26 +0200 |
Hello,
Daniel Gerber <address@hidden> writes:
> The docs say that the REF argument to remote can be "@3$3 or $somename,
> valid in the referenced table". So, adapting the tutorial, the last
> column here should get the same values as the second one, right?
>
>
> | currency | rate (@r$c ref) | rate (named ref) |
> |----------+-----------------+------------------|
> | eur | 1 | nil |
> | usd | 0.77 | nil |
> | sek | 0.12 | nil |
> | sek | 0.12 | nil |
> | sek | 0.12 | nil |
> | nok | 0.14 | nil |
> | | nil | |
> #+TBLFM: $2='(org-lookup-first $1 '(remote(rates,@2$2..@>$2))
> '(remote(rates,@2$3..@>$3)))::$3='(org-lookup-first $1
> '(remote(rates,$abbr)) '(remote(rates,$euros)))
>
>
> #+TBLNAME: rates
> | ! | abbr | euros |
> |---+------+-------|
> | | eur | 1 |
> | | nok | 0.14 |
> | | sek | 0.12 |
> | | usd | 0.77 |
Actually, wrong.
$abbr (respectively $euros) in this case is equivalent to $2
(respectively $3). So your formula becomes
$3='(org-lookup-first $1 '(remote(rates,$2)) '(remote(rates,$3)))
However, $2, or $3, are not valid range references so you do not get
vector of values. However, the following should work as expected
'(org-lookup-first $1 '(remote(rates,@2$abbr..@>$abbr))
'(remote(rates,@2$euros..@>$euros)))
Regards,
--
Nicolas Goaziou