[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-collector calculated rows?
From: |
Nick Dokos |
Subject: |
Re: [O] org-collector calculated rows? |
Date: |
Thu, 10 Mar 2011 00:46:16 -0500 |
Rehan Iftikhar <address@hidden> wrote:
> I have tried adding
>
> #+TBLFM: @>$>=vmean(I..II)
>
> 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.
>
> I am using org-mode 7.4. Any idea why my formula isn't working?
>
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: @>$>=vmean(@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= spendtype "food")) :cols
(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: @>$>=vmean(@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: @>$>=vmean(@I..II)
#+END:
#+TBLFM: @>$> = 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
**** 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---
>
> On Sat, Mar 5, 2011 at 12:48 AM, Nick Dokos <address@hidden> wrote:
> >> Rehan Iftikhar <address@hidden> wrote:
> >>
> >> > * More Complex Example: displaying the mean of the "Amount" column
> >> > for each week.
> >> >
> >
> > I see that I misread this: the formula calculates the mean of all the
> > entries,
> > not the mean for each week. Having thought about it for about 10 seconds,
> > I cannot think of a way to do that.
> >
> > Nick
> >
>
>
>
> --
> -Rehan
>