From mboxrd@z Thu Jan 1 00:00:00 1970 From: Volker Strobel Subject: Re: Relative Remote Reference (column->row) Date: Sun, 23 Mar 2014 22:20:58 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013cb832f351d904f54cb109 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRppG-0002Q4-B4 for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 17:21:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRppD-0001uG-Pa for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 17:21:02 -0400 Received: from mail-oa0-x22f.google.com ([2607:f8b0:4003:c02::22f]:50937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRppD-0001u8-Ke for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 17:20:59 -0400 Received: by mail-oa0-f47.google.com with SMTP id i11so4932378oag.6 for ; Sun, 23 Mar 2014 14:20:58 -0700 (PDT) In-Reply-To: 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: Michael Brand Cc: Org Mode --089e013cb832f351d904f54cb109 Content-Type: text/plain; charset=ISO-8859-1 Thanks, Michael, for this helpful workaround! On Fri, Mar 21, 2014 at 8:19 AM, Michael Brand wrote: > Hi Volker > > On Fri, Mar 21, 2014 at 1:31 AM, Volker Strobel > wrote: > > My problem is, that this remote reference starts in row 3 (because of > @$#), > > however, I'd like to start in row 2 (that means @$#-1). However, this > > relative reference does not seem to work here. > > Calculation within the field reference of Org is not supported but > subscr of Calc can be used to pick calculated references from a range: > > #+NAME: my-table > | Header1 | Header2 | > |---------+---------| > | a | 23 | > | b | 7 | > | c | 13 | > | d | 66 | > | e | 5 | > |---------+---------| > | Result | 42 | > > | x | y | 23 | 7 | 13 | 66 | 5 | > #+TBLFM: @1$3..@1$7 = subscr(remote(my-table, @2$2..6$2), $# - 2) > > (To show the intermediade step: > | x | y | [23, 7, 13, 66, 5] | [23, 7, 13, 66, 5] | > #+TBLFM: @1$3..@1$4 = remote(my-table, @2$2..6$2) > ) > > Michael > --089e013cb832f351d904f54cb109 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks, Michael, for this helpful workaround!


On Fri, Mar 21, 2014= at 8:19 AM, Michael Brand <michael.ch.brand@gmail.com> wrote:
Hi Volker

On Fri, Mar 21, 2014 at 1:31 AM, Volker Strobel
<volker.strobel87@gmail.co= m> wrote:
> My problem is, that this remote reference starts in row 3 (because of = @$#),
> however, I'd like to start in row 2 (that means @$#-1). However, t= his
> relative reference does not seem to work here.

Calculation within the field reference of Org is not supported but subscr of Calc can be used to pick calculated references from a range:

#+NAME: my-table
| Header1 | Header2 |
|---------+---------|
| a =A0 =A0 =A0 | =A0 =A0 =A023 |
| b =A0 =A0 =A0 | =A0 =A0 =A0 7 |
| c =A0 =A0 =A0 | =A0 =A0 =A013 |
| d =A0 =A0 =A0 | =A0 =A0 =A066 |
| e =A0 =A0 =A0 | =A0 =A0 =A0 5 |
|---------+---------|
| Result =A0| =A0 =A0 =A042 |

| x | y | 23 | 7 | 13 | 66 | 5 |
#+TBLFM: @1$3..@1$7 =3D subscr(remote(my-table, @2$2..6$2), $# - 2)

(To show the intermediade step:
| x | y | [23, 7, 13, 66, 5] | [23, 7, 13, 66, 5] |
#+TBLFM: @1$3..@1$4 =3D remote(my-table, @2$2..6$2)
)

Michael

--089e013cb832f351d904f54cb109--