emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stephan Schmitt <drmabuse@cs.tu-berlin.de>
To: emacs-orgmode@gnu.org, Andrew Stribblehill <ads@wompom.org>
Subject: Re: $LR syntax in tables
Date: Wed, 12 Aug 2009 18:39:02 +0200	[thread overview]
Message-ID: <4A82F026.6020701@cs.tu-berlin.de> (raw)
In-Reply-To: <4A82EBF5.3080109@cs.tu-berlin.de>


Stephan wrote:
> Andrew wrote:
>> I'm afraid I can't quite wrap my head around this puzzle. I have a 
>> little table:
>>
>> | Budget       |  640 | 640 |
>> | Some expense | -165 | 475 |
>>   #+TBLFM: $3=$LR3+$2
>>
>> So col C is supposed to add the previous line's col C to the current
>> line's col B.
>>
>> However, it seems that $LR3 is referring to the _subsequent_ line not
>> the previous one. Is there a bug or just my misunderstanding?
>>
>> Thanks.
> 
> Hi Andrew,
> 
> what you need is this:
> 
> |              |      |   0 |
> | Budget       |  640 | 640 |
> | Some expense | -165 | 475 |
> #+TBLFM: $3=@-1+$2::@1$3=0
> 
> the LR-reference is for the last, that is, the bottom row.
> 
> You need the first row and the field formula for C1 in order to 
> initialize the cumulative sum properly.
> 
> hth,
>     Stephan
> 

p.s.
another solution would be:

| Budget       |  640 |  640 |
| Some expense | -165 | -165 |
#+TBLFM: $3=@-1+$2::@1$3=@1$2

Greetings,
	Stephan

  reply	other threads:[~2009-08-12 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090812160618.A958E30520@mailhost.cs.tu-berlin.de>
2009-08-12 16:21 ` Stephan Schmitt
2009-08-12 16:39   ` Stephan Schmitt [this message]
2009-08-12 16:45     ` Stephan Schmitt
2009-08-12 15:01 Andrew Stribblehill

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=4A82F026.6020701@cs.tu-berlin.de \
    --to=drmabuse@cs.tu-berlin.de \
    --cc=ads@wompom.org \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: $LR syntax in tables' \
    /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

Code repositories for project(s) associated with this 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).