emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: abonnements <abonnements@thierry-pelle.eu>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Include results in a table
Date: Tue, 28 Oct 2014 11:54:10 +0100	[thread overview]
Message-ID: <CALn3zoh0Br6NrULGwFLzXFq-KVCN2_MN7r-8tvXcFQGxgMAcbw@mail.gmail.com> (raw)
In-Reply-To: <544F5BA4.3090703@thierry-pelle.eu>

Hi Thierry

On Tue, Oct 28, 2014 at 10:02 AM, abonnements
<abonnements@thierry-pelle.eu> wrote:
> #+call: gen(A)
> #+results: A
> : 10
>
> #+call: gen(B)
> #+results: B
> : 20
>
> Is there a simple mean to aggregate the results in a table, i.e to get
> | A | 10 |
> | B | 20 |

One solution with TBLFM is:

#+BEGIN_SRC emacs-lisp
  '(10)
#+END_SRC

#+NAME: A
#+RESULTS:
| 10 |

#+BEGIN_SRC emacs-lisp
  '(20)
#+END_SRC

#+NAME: B
#+RESULTS:
| 20 |

Aggregate multiple tables:
| Table | Value |
|-------+-------|
| A     |    10 |
| B     |    20 |
#+TBLFM: @<<$2..@>$2 = remote($1, @1$1)

Requires Emacs 24.4 or an Org version from at least 2014.

For reference see also the unit test in the Org source
testing/lisp/test-org-table.el test-org-table/remote-reference-indirect

Michael

  parent reply	other threads:[~2014-10-28 10:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28  9:02 Include results in a table abonnements
2014-10-28  9:34 ` Thorsten Jolitz
2014-10-28 10:54 ` Michael Brand [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-10-28 10:08 abonnements
2014-10-28 10:44 ` Thorsten Jolitz

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=CALn3zoh0Br6NrULGwFLzXFq-KVCN2_MN7r-8tvXcFQGxgMAcbw@mail.gmail.com \
    --to=michael.ch.brand@gmail.com \
    --cc=abonnements@thierry-pelle.eu \
    --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).