From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: table formula help... Date: Sat, 13 Dec 2014 19:27:19 +0100 Message-ID: References: <87ppbxfi5f.fsf@ericabrahamsen.net> <54838805.8090705@free.fr> <8761do6t01.fsf@ericabrahamsen.net> <5484CD5C.9070604@free.fr> <5487471D.5070807@free.fr> <5487793C.1080800@free.fr> <5488CF51.8000006@free.fr> <548B585F.6000404@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzrPV-0007Xz-Nl for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 13:27:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzrPU-00031F-EP for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 13:27:21 -0500 Received: from mail-qa0-x22a.google.com ([2607:f8b0:400d:c00::22a]:40699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzrPU-000315-AT for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 13:27:20 -0500 Received: by mail-qa0-f42.google.com with SMTP id n4so127465qaq.15 for ; Sat, 13 Dec 2014 10:27:19 -0800 (PST) In-Reply-To: <548B585F.6000404@free.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thierry Banel Cc: Org Mode Hi Thierry On Fri, Dec 12, 2014 at 10:04 PM, Thierry Banel wrot= e: > Le 12/12/2014 18:15, Michael Brand a =C3=A9crit : > Seems doable. > Would tie the spreadsheet and orgaggregate seamlessly. > Very appealing! > > Are you willing to help me implement those steps? Where necessary I try to help. I would break it down to these commits and take a larger break after 3): 1) Prepare for Calc syntax: Adapt the "(case fun [...]" of orgtbl-aggregate-apply-calc-*-function to move from :cols "sum(x)" etc. to :cols "vsum(x)" etc. #+BEGIN: aggregate :table test :cols ("Item" "vsum(x)") | Item | vsum(x) | |------+---------| 2) Add a separate target column header: The "=3D" is only a suggestion how to separate the target column header from the formula. #+BEGIN: aggregate :table test :cols ("Item" "Header =3D vsum(x)") | Item | Header | |------+--------| 3) Unleash complete Calc syntax: Make use of (org-table-make-reference with KEEP-EMPTY and NUMBERS constantly nil and use calc-eval #+BEGIN: aggregate :table test :cols ("Item" "Header =3D 2 * vsum(x) + 3 * vmean(y)") | Item | Header | |------+--------| 4) Add the mode strings "E" and "N": Parse and pass them to KEEP-EMPTY and NUMBERS of org-table-make-reference. #+BEGIN: aggregate :table test :cols ("Item" "Header =3D 2 * vsum(x) + 3 * vmean(y); EN") | Item | Header | |------+--------| 5) Someday add more mode strings. Michael