[Top][All Lists]

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

[O] Using org-lookup-all to count values in a table column

From: William Denton
Subject: [O] Using org-lookup-all to count values in a table column
Date: Tue, 24 Sep 2013 13:42:34 -0400 (EDT)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

I'm taking a stab at keeping my reading diary in Org. I keep track of all the books I read, and some other facts about them, including whether they're fiction (F) or nonfiction (N).

So I would have a table something like the books table below, and I'd like to do some analysis on it and put the results in another table. I'd like to count how many books are of Type F and how many of Type N, and it looks like matching values with org-lookup-all (as explained in [1]) is the right way, but I can't get it to work.

I have this:

#+TBLNAME: books
| Title            | Author         | Type |
| NOS4A2           | Joe Hill       | F    |
| Gun Machine      | Warren Ellis   | F    |
| Carry On, Jeeves | P.G. Wodehouse | F    |
| Time Reborn      | Lee Smolin     | N    |

#+TBLNAME: analysis
| Fact              | Value |
| Fiction books     |     1 |
| Nonfiction  books |       |
#+TBLFM: address@hidden'(length(org-lookup-all "F" 
'(remote(books,address@hidden@>)) nil))

The fiction count should be 3, not 1. Can anyone see what I'm doing wrong?



[1] http://orgmode.org/worg/org-tutorials/org-lookups.html

William Denton
Toronto, Canada

reply via email to

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