emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: theo <theocrite@theocrite.org>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: making flexible table formulas
Date: Tue, 01 Mar 2011 05:41:12 +0100	[thread overview]
Message-ID: <4D6C78E8.4070806@theocrite.org> (raw)
In-Reply-To: <AANLkTimkEbZkcWWjHOC4nrWLhj-ZUddROei+O_sJDO+d@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/03/2011 04:19, Rustom Mody wrote:
> Nick Dokos wrote:
> 
>> Of course it's reasonable - and of course, org implements it
>> #+TBLFM: $LR2=vsum(@1..@-1)
> 
> Thanks Nick I can use that. But I dont understand it.  What's the -1?
> The manual says -- relative to 'current' column.
> What determines 'current?' There must be some obvious POV which I am missing...

@X = row X, absolute.
@-X = X rows before, relative.

For instance :

I*1 |A--|
   1| 1 |
   2| 2 |
   3| 3 |
I*2 |A--|
   4| 6 |
I*3 |A--|
#+TBLFM: $1=vsum(@1..@-1)

Here the 4th row is the sum. So @-1refers to the 3rd row.

If we add a new row before, the sum still works.

I*1 |A---|
   1|  1 |
   2|  2 |
   3|  3 |
   4| 42 |
I*2 |A---|
   5| 48 |
I*3 |A---|
#+TBLFM: $1=vsum(@1..@-1)

@-1 now refers to the 4 row.
- -- 
freely yours,
theo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNbHjoAAoJECkgngj8k9TvPggIAKXvaaz4HfzPOiU2RAajBqYq
/qFYvk5Pf3e1QJme8qiiY0JWiW6isS+YI7bg9Hg6XLe5F3qxm20zz3Z008jWyZuN
TBhsr6ox0B3Hf3OnienQrhUvm8v1bIWiEhJFd/qBG0mp8dY5zeuJro6bLWrZxKhn
zVO0dw7rh3xQoYIOzRIoP1wnykg2xw3st4GH4JqdSusLhAwy/AfkvjgXBf3qbZ/p
FU8ksalYgQUb9S+GGpFdzIyPqJ+d7m3JbAQHbZ0Wpak0oCR306BGIcBuqMqzAZCd
5ukuHJr+Ug4Mlt+OjreAJajeMUVAYTSCU46nupuEJysK4egKEz0LLcNPzoXr7BU=
=o6Qk
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

  reply	other threads:[~2011-03-01  4:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01  3:19 making flexible table formulas Rustom Mody
2011-03-01  4:41 ` theo [this message]
2011-03-01  5:10 ` Nick Dokos
  -- strict thread matches above, loose matches on Subject: below --
2011-02-28 17:35 Rustom Mody
2011-02-28 18:14 ` Luke Crook
2011-02-28 18:18 ` Nick Dokos
2011-03-01  9:08 ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D6C78E8.4070806@theocrite.org \
    --to=theocrite@theocrite.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).