emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Table formulas: Cannot use column names on the left hand side
@ 2012-02-16 15:56 Yu
  2012-02-16 16:52 ` Michael Brand
  0 siblings, 1 reply; 2+ messages in thread
From: Yu @ 2012-02-16 15:56 UTC (permalink / raw)
  To: org-mode mailing list

Hello!

I tried today to use named columns for calculations. While this works
on the right hand side of the equation, names don't seem to work for
the left hand side -- which is a problem, because a change in column
arrangement, that isn't caused by org functions (e.g. manually
inserting a column with rectangle-copying) may cause an input column
to be overwritten accidentially (e.g. having a formula $4=$3*$2+$1 and
then manually inserting a column for line markers as described in
"Advanced Features").

Exactly this happened to me recently, forcing me to redo some by-hand
evaluation.

Here some examples to clarify the problem:

-----------------------------------------------------------------------------

Recalculation attempts done each with C-u C-c C-c in the table and
with C-c C-c in the formula line, and with C-u C-c *.

Works fine:
|   a |   b | a+b |
|-----+-----+-----|
| 1.0 | 1.0 | 2.0 |
| 1.5 | 0.5 | 2.0 |
| 0.5 | 0.0 | 0.5 |
#+TBLFM: $3=$1+$2;%.1f

Doesn't Work:
|   |   a |   b | a+b |
|---+-----+-----+-----|
|   | 1.0 | 1.0 |     |
|   | 1.5 | 0.5 |     |
|   | 0.5 | 0.0 |     |
| ! |   a |   b | ab  |
#+TBLFM: $ab=$a+$b

Doesn't Work:
|   |   a |   b | a+b |
|---+-----+-----+-----|
|   | 1.0 | 1.0 |     |
|   | 1.5 | 0.5 |     |
|   | 0.5 | 0.0 |     |
| ! |   a |   b | ab  |
#+TBLFM: $4=$a+$b

Even this doesn't work
|   |   a |   b | a+b |
|---+-----+-----+-----|
|   | 1.0 | 1.0 |     |
|   | 1.5 | 0.5 |     |
|   | 0.5 | 0.0 |     |
| ! |   a |   b | ab  |
#+TBLFM: $4=$2+$3

This works again; This is sort of consistent with the specification,
that "Unmarked lines are exempt from recalculation with C-u C-c *",
but there was no mention, that it affects other methods of causing
recalculation too in `(info "(org)")'.
|   |   a |   b | a+b |
|---+-----+-----+-----|
| * | 1.0 | 1.0 |  2. |
| * | 1.5 | 0.5 |  2. |
| * | 0.5 | 0.0 | 0.5 |
| ! |   a |   b |  ab |
#+TBLFM: $4=$2+$3

This again does NOT work.
|   |   a |   b | a+b |
|---+-----+-----+-----|
| * | 1.0 | 1.0 |     |
| * | 1.5 | 0.5 |     |
| * | 0.5 | 0.0 |     |
| ! |   a |   b | ab  |
#+TBLFM: $ab=$2+$3

Works again.
|   |   a |   b | a+b |
|---+-----+-----+-----|
| * | 1.0 | 1.0 |  2. |
| * | 1.5 | 0.5 |  2. |
| * | 0.5 | 0.0 | 0.5 |
| ! |   a |   b |  ab |
#+TBLFM: $4=$a+$b

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Table formulas: Cannot use column names on the left hand side
  2012-02-16 15:56 Table formulas: Cannot use column names on the left hand side Yu
@ 2012-02-16 16:52 ` Michael Brand
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Brand @ 2012-02-16 16:52 UTC (permalink / raw)
  To: Yu; +Cc: org-mode mailing list

Hi Yu

On Thu, Feb 16, 2012 at 16:56, Yu <yu_icq@gmx.at> wrote:
> I tried today to use named columns for calculations. While this works
> on the right hand side of the equation, names don't seem to work for
> the left hand side --

Named columns are not supported on the left hand side.

> which is a problem, because a change in column
> arrangement, that isn't caused by org functions (e.g. manually
> inserting a column with rectangle-copying) may cause an input column
> to be overwritten accidentially (e.g. having a formula $4=$3*$2+$1 and
> then manually inserting a column for line markers as described in
> "Advanced Features").

If one uses M-<left> and M-<right> instead of rectangle edit to move
around columns then it is much faster and Org takes care of adapting
the formulas so that they still match the new coordinates.

Michael

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-16 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 15:56 Table formulas: Cannot use column names on the left hand side Yu
2012-02-16 16:52 ` Michael Brand

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).