[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Table formulas: Cannot use column names on the left hand side
From: |
Yu |
Subject: |
[O] Table formulas: Cannot use column names on the left hand side |
Date: |
Thu, 16 Feb 2012 16:56:43 +0100 |
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
- [O] Table formulas: Cannot use column names on the left hand side,
Yu <=