emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Saving column views in agenda


From: Eric Schulte
Subject: Re: [Orgmode] Saving column views in agenda
Date: Thu, 11 Dec 2008 11:09:17 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Matthew Lundin <address@hidden> writes:

> Eric,
>
> Thanks so much. The updated org-collector works beautifully. This is a
> very nice way to perform calculations on subsets of data. I don't
> suppose there's any chance of generating a table that contains only
> the items in the subset (e.g., only items in which string= spendtype
> "food")?
>

Hi Matthew,

Good idea.  I've added a :conds parameter which can do just that, see
the example below.  Notice that :conds should be a list of tests, not
just one single test, if this proves awkward it would be easy to add
a :cond parameter which doesn't require a list.

One issue with this setup, is that it's not clear what a stable way
would be to specify the #+TBLFM line.  Since the size of the table could
vary the field in which the sum should be placed could move around.
With the table below a #+TBLFM line like this

  #+TBLFM: @II+1$2=vsum(@address@hidden)

would work, but currently org-table does not allow the @I style
references before the = sign in the table formula.  I wonder if this
would be hard difficult to change?

Thanks -- Eric



* 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 |
|----------------------------------+----------|
|                                  |    87.44 |
#+TBLFM: @4$2=vsum(@address@hidden)
#+END:

** December Spending
   :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:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]