emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Stephan Schmitt <drmabuse@cs.tu-berlin.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Spreadsheet bug?
Date: Mon, 3 Aug 2009 06:31:18 +0200	[thread overview]
Message-ID: <24CB4D3A-64EE-4E9A-A00B-9C58591C6299@gmail.com> (raw)
In-Reply-To: <4A697CFA.6050001@cs.tu-berlin.de>


On Jul 24, 2009, at 11:20 AM, Stephan Schmitt wrote:

> Andreas Burtzlaff wrote:
>> On Thu, 23 Jul 2009 02:29:30 +0200 meingbg <meingbg@gmail.com> wrote:
>>>> | a |  b | c |
>>>> |---+----+---|
>>>> | a |  2 | 2 |
>>>> | b |  3 | 7 |
>>>> | c | -3 | 4 |
>>>> | d |  5 | 9 |
>>>> #+TBLFM: $3=$2+@-1::@2$3=$2
>>
>
>> If @2$3 is manually set to 2 in the table, then the formulas produce
>> the expected outcome. So, the problem seems to be the order of
>> execution. If column c is cleared and the formulas are executed, @2$3
>> is read to be 0 for the summation and is set to 2 only afterwards.
>> Swapping the order in the TBLFM line doesn't help.
>>
>> Is the order something like field formulas after column formulas?
>> Any chance to influence that?
>
> Evaluating the field formulas before the column formulas is in  
> general a bad
> idea.  Results of the field formulas will always be overwritten by  
> the column
> formulas (if there is a conflict).

When recomputing a table,  Org evaluates field formulas first.
Then it does the column formulas, but never overwrites a field
that was filled with a field formula.

As mentioned elsewhere in this thread

>
> Here you need to evaluate the spreadsheet twice to yield the  
> intended result (I
> get a 5 in field @2$3).

Indeed, this is what is needed here.

- Carsten


>  From info:org:Updating the table:
>
>> `C-u C-u C-c *'
>> `C-u C-u C-c C-c'
>>     Iterate the table by recomputing it until no further changes  
>> occur.
>>     This may be necessary if some computed fields use the value of
>>     other fields that are computed later in the calculation sequence.
>
> hth,
> 	Stephan
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-08-03  4:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090723160554.5AA76324F7@mailhost.cs.tu-berlin.de>
2009-07-24  9:20 ` Spreadsheet bug? Stephan Schmitt
2009-08-03  4:31   ` Carsten Dominik [this message]
2009-07-23 10:17 meingbg
2009-07-23 10:39 ` Andreas Burtzlaff
2009-07-24 15:20   ` meingbg
  -- strict thread matches above, loose matches on Subject: below --
2009-07-23  0:29 meingbg
2009-07-23  9:04 ` Andreas Burtzlaff

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=24CB4D3A-64EE-4E9A-A00B-9C58591C6299@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=drmabuse@cs.tu-berlin.de \
    --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).