emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [ANN] Aggregate Table


From: Thierry Banel
Subject: [O] [ANN] Aggregate Table
Date: Sat, 25 Oct 2014 17:00:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Hi all

I'm happy to announce the availability of the aggregation package.
https://github.com/tbanel/orgaggregate

Example:

This is a source table:
#+TBLNAME: source
| Day       | Quantity |
|-----------+----------|
| Monday    |       10 |
| Monday    |        3 |
| Tuesday   |       52 |
| Tuesday   |       15 |
| Tuesday   |       18 |
| Wednesday |      100 |
| Wednesday |       23 |
| Wednesday |       16 |

This is an aggregated result computed by the package:
#+BEGIN: aggregate :table source :cols "Day sum(Quantity)"
| Day       | sum(Quantity) |
|-----------+---------------|
| Monday    |            13 |
| Tuesday   |            85 |
| Wednesday |           139 |
#+END:

For those familiar with SQL, this is reminicent of the GROUP BY statement.
For those familiar with the R statistics, this is reminicent of FACTORS.

Features include:
- Pure Emacs (no external dependency)
- Wide variety of aggregation functions (sum, mean, max, count, median,
etc.)
- Calc underlying engine (the same used by Org spreadsheet)
- Work in push or pull mode (pull mode uses so called dynamic blocks)
- Any combination of key columns
- and more

To use it:

- load in Emacs
  https://github.com/tbanel/orgaggregate/blob/master/org-aggregate.el
  This give access to the command:
  M-x org-insert-dblock:aggregate

- look at the examples and documentation here:
  https://github.com/tbanel/orgaggregate

- optionally load
  https://github.com/tbanel/orgaggregate/blob/master/org-insert-dblock.el
  This gives the following key-binding:
  C-c C-x i
  which insert any kind of dynamic blocks, including "aggregate"


Feedback welcome.

Have fun
Thierry





reply via email to

[Prev in Thread] Current Thread [Next in Thread]