[O] Table formulas: Cannot use column names on the left hand side

2012-02-16 Thread Yu
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



Re: [O] Table formulas: Cannot use column names on the left hand side

2012-02-16 Thread Michael Brand
Hi Yu

On Thu, Feb 16, 2012 at 16:56, Yu yu_...@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