From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: org-collector calculated rows? Date: Thu, 10 Mar 2011 00:46:16 -0500 Message-ID: <17363.1299735976@alphaville.dokosmarshall.org> References: <4387.1299314630@alphaville.dokosmarshall.org> <4437.1299314926@alphaville.dokosmarshall.org> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=53908 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxYux-0006Im-6k for emacs-orgmode@gnu.org; Thu, 10 Mar 2011 01:00:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxYhp-0003cx-SH for emacs-orgmode@gnu.org; Thu, 10 Mar 2011 00:46:39 -0500 Received: from vms173001pub.verizon.net ([206.46.173.1]:32778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxYhp-0003cp-Ov for emacs-orgmode@gnu.org; Thu, 10 Mar 2011 00:46:37 -0500 Received: from alphaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173001.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LHT00L2XUP5GCA0@vms173001.mailsrvcs.net> for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 23:46:23 -0600 (CST) In-reply-to: Message from Rehan Iftikhar of "Wed\, 09 Mar 2011 21\:21\:51 PST." 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: Rehan Iftikhar Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Rehan Iftikhar wrote: > I have tried adding >=20 > #+TBLFM: @>$>=3Dvmean(I..II) >=20 > between the #+BEGIN and #+END lines (after generating a table), but > when I C-c C-c on #+BEGIN, the table refreshes and removes the #+TBLFM > line. >=20 > I am using org-mode 7.4. Any idea why my formula isn't working? >=20 I don't know why the #+TBLFM line disappears: it does not in my case - assuming that I've got org-collector loaded: since it's a contrib package it's not loaded automatically for me and when I tried the refresh before loading org-collector, *everything* disappeared: the table and the formula. But once I got the package loaded correctly, things worked as I described before: if only the formula is in there, it gets wiped out, but if there is a table along with the formula, the table gets refreshed and the formula is recalculated. BTW, the formula is wrong: it should read --8<---------------cut here---------------start------------->8--- #+TBLFM: @>$>=3Dvmean(@I..II) --8<---------------cut here---------------end--------------->8--- and that also assumes that you are running a very recent version of org, one that recognizes @> and $>. But neither of these would explain why the formula is wiped. Nick PS. I'm using Eric Schulte's standard example from the Worg site: --8<---------------cut here---------------start------------->8--- * Example #+BEGIN: propview :id "december" :conds ((string=3D spendtype "food")) :col= s (ITEM amount) | "ITEM" | "amount" | |----------------------------------+----------| | "Grocery Store [2008-12-01 Mon]" | 56.77 | | "Restaurant [2008-12-08 Mon]" | 30.67 | | "Grocery Store [2008-12-09 Tue]" | 56.76 | |----------------------------------+----------| | | | #+TBLFM: @>$>=3Dvmean(@I..II) #+END: #+BEGIN: propview :cols (ITEM (+ 400 amount)) :scope tree :match "example" | "ITEM" | "(+ 400 amount)" | |----------------------------------+------------------| | "December Spending" | 0 | | "Week One" | 0 | | "Grocery Store [2008-12-01 Mon]" | 456.77 | | "Athletic club [2008-12-02 Tue]" | 475.0 | | "Week Two " | 0 | | "Restaurant [2008-12-08 Mon]" | 430.67 | | "Grocery Store [2008-12-09 Tue]" | 456.76 | |----------------------------------+------------------| | | 259.88571 | #+TBLFM: @>$>=3Dvmean(@I..II) #+END: #+TBLFM: @>$> =3D vmean(@I..II) ** December Spending :example: :PROPERTIES: :ID: december :END: *** Week One **** Grocery Store [2008-12-01 Mon] :PROPERTIES: :amount: 56.77 :spendtype: food :END: **** Athletic club [2008-12-02 Tue] :PROPERTIES: :amount: 75.00 :spendtype: health :END: *** Week Two=20 **** Restaurant [2008-12-08 Mon] :PROPERTIES: :amount: 30.67 :spendtype: food :END: **** Grocery Store [2008-12-09 Tue] :PROPERTIES: :amount: 56.76 :spendtype: food :END: --8<---------------cut here---------------end--------------->8--- >=20 > On Sat, Mar 5, 2011 at 12:48 AM, Nick Dokos wrote: > >> Rehan Iftikhar wrote: > >> > >> > =C2=A0 * More Complex Example: displaying the mean of the "Amount" c= olumn > >> > for each week. > >> > > > > > I see that I misread this: the formula calculates the mean of all the e= ntries, > > not the mean for each week. Having thought about it for about 10 second= s, > > I cannot think of a way to do that. > > > > Nick > > >=20 >=20 >=20 > --=20 > -Rehan >=20