emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bruno Barbier <brubar.cs@gmail.com>
To: Paul Stansell <paulstansell@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Named columns in org tables [9.7-pre (release_9.6.9-797-g4d0f89]
Date: Wed, 27 Sep 2023 14:10:37 +0200	[thread overview]
Message-ID: <65141bbf.050a0220.b1f34.e135@mx.google.com> (raw)
In-Reply-To: <CAMJKaZw_MrxWkBG-5AsLuOPZRqXojjE8D7TVDGJW+jztYshXWg@mail.gmail.com>


Hi Paul,

Paul Stansell <paulstansell@gmail.com> writes:

> Hello,
>
> On this page https://orgmode.org/manual/Advanced-features.html
> it says
> - '!' :: The fields in this line define names for the columns, so that
>   you may refer to a column as '$Tot' instead of '$6'.
> ...
> |---+----+----+----|
> | ! | c1 | c2 | c3 |
> | # |  1 |  2 |    |
> | # |  3 |  4 |    |
> |---+----+----+----|
> #+TBLFM: $c3 = $c1 + $c2
>
> Is this a bug?

It seems to me it's a bug in the documentation.

Currently, column names are not allowed in the LHS (Left Hand Side) of
the formula ('org-table-get-stored-formulas' assumes it).  Although I'm
not sure why.

In other words, you'll need to use the real column number
for the column that holds the results. This should work:

   | ! | c1 | c2 | c3 |
   |---+----+----+----|
   | # |  1 |  4 |  3 |
   | # |  3 | 10 |  7 |
   #+TBLFM: $3 = $c1 + $c2



Bruno


  reply	other threads:[~2023-09-27 12:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 22:46 Named columns in org tables [9.7-pre (release_9.6.9-797-g4d0f89] Paul Stansell
2023-09-27 12:10 ` Bruno Barbier [this message]
     [not found]   ` <CAMJKaZx2TseskAb7J+7AfKaFzcbDmJ32LPfv4VcPDAU=WRQNUA@mail.gmail.com>
2023-09-27 14:38     ` Fwd: " Paul Stansell
2023-09-27 14:40       ` Paul Stansell
2023-09-27 15:53         ` Bruno Barbier
2023-09-27 15:44       ` Fwd: " Bruno Barbier
2023-10-05 10:09 ` Ihor Radchenko

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=65141bbf.050a0220.b1f34.e135@mx.google.com \
    --to=brubar.cs@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=paulstansell@gmail.com \
    /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).