From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell Adams Subject: Re: Spreadsheet FR Date: Fri, 2 Apr 2010 09:55:16 -0500 Message-ID: <20100402145516.GC7194@thinkpad.adamsinfoserv.com> References: <20100401214648.GL7262@thinkpad.adamsinfoserv.com> <49A58658-88AF-4A88-93E9-1CDB710B08A2@gmail.com> <878w95sym0.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NxiHO-0004fs-5x for emacs-orgmode@gnu.org; Fri, 02 Apr 2010 10:55:26 -0400 Received: from [140.186.70.92] (port=43889 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NxiHM-0004fH-TG for emacs-orgmode@gnu.org; Fri, 02 Apr 2010 10:55:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NxiHL-0003Rc-50 for emacs-orgmode@gnu.org; Fri, 02 Apr 2010 10:55:24 -0400 Received: from squirtle.drak.net ([72.52.144.201]:41776) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NxiHK-0003RU-UU for emacs-orgmode@gnu.org; Fri, 02 Apr 2010 10:55:23 -0400 Received: from 206.180.155.43.adsl.hal-pc.org ([206.180.155.43] helo=localhost) by squirtle.drak.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1NxiHG-0004hT-0F for emacs-orgmode@gnu.org; Fri, 02 Apr 2010 09:55:18 -0500 Content-Disposition: inline In-Reply-To: <878w95sym0.fsf@stats.ox.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode On Fri, Apr 02, 2010 at 10:44:23AM -0400, Dan Davison wrote: > How about keeping a master table containing all the information, and > then generating narrowed views as separate tables? The babel way to do > this would be to have a block function "filter-table" (provided below) > and then call it where needed: > > #+TBLNAME: lime-table > | *Lime* | *Cost* | > |--------+--------| > | Y | 1 | > | Y | 2 | > | Y | 2 | > | N | 3 | > | N | 4 | > | Y | 5 | > | Total | 17 | > #+TBLFM: @8$2=vsum(@-I..@-II) > > #+call: filter-table(table=lime-table, field=0, value="Y") > > #+results: filter-table(table=lime-table, field=0, value="Y") > | *Lime* | *Cost* | > |--------+--------| > | Y | 1 | > | Y | 2 | > | Y | 2 | > | Y | 5 | > > As you can see I got rid of a few horizontal separator lines, and we > don't currently have totals. I'll suggest fixes for that below, but my > main point is that although it may make sense to extend org-mode, it's > already easy to do this in org-babel. That's a better way to do it than properties in my opinion. Whether extension was required or not, my only point was that for small lists the only reason I still use OO or Excel was for the ability to dynamically narrow a list. Given org narrows outlines, I thought it might fit. I'll have to play with babel now! > OK, so I hard wired a 6 into the TBLFM line. Perhaps someone can tell me > how to refer to the last line of the table. Also, it might be nice if > babel could apply the table formula automaticaly after generating the > table. This is why I use @-I..@-II, the separators are your cues. There's an LR symbol, but I don't use it often. That alone is a good reason to make sure separator lines are preserved. Thanks. ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3