From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: table formula help... Date: Sun, 07 Dec 2014 10:20:26 +0100 Message-ID: <54841BDA.1030801@free.fr> References: <87ppbxfi5f.fsf@ericabrahamsen.net> <54838805.8090705@free.fr> <8761do6t01.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxY13-000669-2x for emacs-orgmode@gnu.org; Sun, 07 Dec 2014 04:20:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxY0y-00076s-Qh for emacs-orgmode@gnu.org; Sun, 07 Dec 2014 04:20:32 -0500 Received: from smtp4-g21.free.fr ([212.27.42.4]:40261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxY0y-00076a-La for emacs-orgmode@gnu.org; Sun, 07 Dec 2014 04:20:28 -0500 Received: from [IPv6:2a01:e35:2e21:def0:945c:654d:e692:22ed] (unknown [IPv6:2a01:e35:2e21:def0:945c:654d:e692:22ed]) by smtp4-g21.free.fr (Postfix) with ESMTP id 482FF4C8079 for ; Sun, 7 Dec 2014 10:20:05 +0100 (CET) In-Reply-To: <8761do6t01.fsf@ericabrahamsen.net> 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: emacs-orgmode@gnu.org Le 07/12/2014 04:25, Eric Abrahamsen a =E9crit : > > Okay, having fun! This seems like exactly what I was after. A couple of > things: > > I've attached a patch replacing some [a-z] regexps with [:word:], so > that column names can be written in scripts other than ascii (my tables > above are actually all in Chinese). I hope that's acceptable. Not only it is acceptable, it is also very welcome! Your patch has been pushed to GitHub along with an updated unittests.org (https://github.com/tbanel/orgaggregate). Wait for a couple of hours for Melpa to refresh (http://melpa.org). > I've changed blank fields to "0" so that I don't get the "NA" strings. > > Now I'd like to do more calculations based on the rows in the sum(Chars= ) > and sum(Lines) columns. > > Ideally I could add a fourth column to the aggregate table, calculated > from rows in the previous two. Is there any way to make a column > specification that refers to columns in the same table? The fourth > column would be defined as: > > (sum(prod($2 0.7) prod($3 10)) > > Where $2 and $3 refer to cells in the aggregated table. It would be great of course. However I don't know how to do that cleanly. If we want total flexibility for the formulas, we will end up duplicating the native features of Org spreadsheet. > I made that up -- I don't even know if it's valid calc syntax. But > that's the idea. Or perhaps I should be making a third table based on > this second one? This would be the easiest for the time being. You can also add columns and formulas to the 2nd table in the usual way (Alt-Shift-RightArrow, then C-c =3D). But beware that those additions wil= l be cleared by an aggregate refresh. > Thanks again! > > Eric > You are welcome Thierry