[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Sub-totals
From: |
Michael Brand |
Subject: |
Re: [O] Sub-totals |
Date: |
Sun, 16 Feb 2014 10:06:14 +0100 |
Hi Cecil
On Sat, Feb 15, 2014 at 6:14 PM, Cecil Westerhof <address@hidden> wrote:
> - I would like to have only the last element of the range filled.
I always thought that this would not be possible with reasonable
effort. Your question made me think again and it is possible, now I
can change my own use cases with sub-total :-) . See docstring and
take the procedure with vlen etc. from the TBLFM of the new ERT
test-org-table/sub-total here:
http://orgmode.org/w/org-mode.git?p=org-mode.git;a=blob;f=testing/lisp/test-org-table.el
Or read the docstring there and just take this copy that I used to
build the ERT:
|-------+-------+-------|
| Item | Item | Sub- |
| name | value | total |
|-------+-------+-------|
| a1 | 4.1 | |
| a2 | 8.2 | |
| a3 | | 12.3 |
|-------+-------+-------|
| b1 | 16.0 | 16.0 |
|-------+-------+-------|
| c1 | 32 | |
| c2 | 64 | 96.0 |
|-------+-------+-------|
| Total | 124.3 | |
|-------+-------+-------|
#+TBLFM: @>$2 = vsum(@II..@>>) :: $3 = if(vlen(@address@hidden) ==
vlen(@address@hidden), vsum(@address@hidden) +.0, string("")); EN f-1 ::
@>$3 = string("")
Michael