From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cecil Westerhof Subject: Re: Sub-totals Date: Sat, 15 Feb 2014 18:31:01 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c0e85c4e7aaa04f27549ab Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEj4y-0001LN-KP for emacs-orgmode@gnu.org; Sat, 15 Feb 2014 12:31:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEj4w-00049i-D0 for emacs-orgmode@gnu.org; Sat, 15 Feb 2014 12:31:04 -0500 Received: from mail-qa0-x22e.google.com ([2607:f8b0:400d:c00::22e]:56365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEj4w-00049c-6S for emacs-orgmode@gnu.org; Sat, 15 Feb 2014 12:31:02 -0500 Received: by mail-qa0-f46.google.com with SMTP id k15so6487779qaq.5 for ; Sat, 15 Feb 2014 09:31:01 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001a11c0e85c4e7aaa04f27549ab Content-Type: text/plain; charset=ISO-8859-1 2014-02-15 18:14 GMT+01:00 Cecil Westerhof : > 2014-02-15 16:19 GMT+01:00 Michael Brand : > > What about this?: >> >> |--------------+------+-----| >> | activity | Time | sub | >> |--------------+------+-----| >> | Activity A | 3 | | >> |--------------+------+-----| >> | Activity B | 5 | 34 | >> | Activity C | 2 | 34 | >> | Activity D | 7 | 34 | >> | Activity E | 8 | 34 | >> | Activity F | 12 | 34 | >> |--------------+------+-----| >> | Activity 1 | 9 | 18 | >> | Activity 2 | 2 | 18 | >> | Activity 3 | 4 | 18 | >> | Activity 4 | 3 | 18 | >> |--------------+------+-----| >> | Activity I | 23 | 111 | >> | Activity II | 51 | 111 | >> | Activity III | 37 | 111 | >> |--------------+------+-----| >> | | 163 | | >> |--------------+------+-----| >> #+TBLFM: @>$2 = vsum(@<<<..@>>) :: @<<<$3..@>>$3 = vsum(@-I$2..@+I$2) >> > > It is certainly a big step in the right direction. I have to study it to > understand what it does. (You also changed the part I already had. I have > to look to see why that is better.) > > There are a few problems with it: > - As your example shows, the first element is not filled and when the > first range only has one element ... > - I would like to have only the last element of the range filled. > > But it is certainly helpful: thanks. > When looking better I saw there was a nasty bug. The following works and gets rid of the first 'problem': |--------------+------+-----| | activity | Time | sub | |--------------+------+-----| | Activity A | 3 | 3 | |--------------+------+-----| | Activity B | 5 | 34 | | Activity C | 2 | 34 | | Activity D | 7 | 34 | | Activity E | 8 | 34 | | Activity F | 12 | 34 | |--------------+------+-----| | Activity 1 | 9 | 18 | | Activity 2 | 2 | 18 | | Activity 3 | 4 | 18 | | Activity 4 | 3 | 18 | |--------------+------+-----| | Activity I | 23 | 111 | | Activity II | 51 | 111 | | Activity III | 37 | 111 | |--------------+------+-----| | | 166 | | |--------------+------+-----| #+TBLFM: @>$2 = vsum(@<<..@>>) :: @<<$3..@>>$3 = vsum(@-I$2..@+I$2) -- Cecil Westerhof --001a11c0e85c4e7aaa04f27549ab Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2014= -02-15 18:14 GMT+01:00 Cecil Westerhof <cldwesterhof@gmail.com>= ;:
2014-02-15 16:19 GMT+01:00 Mi= chael Brand <michael.ch.brand@gmail.com>:

What about this?:

|--------------+------+-----|
| activity     | Time | sub |
|--------------+------+-----|
| Activity A   |    3 |     |
|--------------+------+-----|
| Activity B   |    5 |  34 |
| Activity C   |    2 |  34 |
| Activity D   |    7 |  34 |
| Activity E   |    8 |  34 |
| Activity F   |   12 |  34 |
|--------------+------+-----|
| Activity 1   |    9 |  18 |
| Activity 2   |    2 |  18 |
| Activity 3   |    4 |  18 |
| Activity 4   |    3 |  18 |
|--------------+------+-----|
| Activity I   |   23 | 111 |
| Activity II  |   51 | 111 |
| Activity III |   37 | 111 |
|--------------+------+-----|
|              |  163 |   &nbs= p; |
|--------------+------+-----|
#+TBLFM: @>$2 =3D vsum(@<<<..@>>) :: @<<<$= 3..@>>$3 =3D vsum(@-I$2..@+I$2)

There are a few problems with it:
- As your example shows, the first element is not filled a= nd when the first range only has one element …
- I would like to ha= ve only the last element of the range filled.

But it is certainly helpful: thanks.

Wh= en looking better I saw there was a nasty bug. The following works and gets= rid of the first ‘problem’:
|--------------+------+-----|
| activity     | Time = | sub |
|--------------+------+-----|
| Activity A   | = ;   3 |   3 |
|--------------+------+-----|
| Act= ivity B   |    5 |  34 |
| Activity C = ;  |    2 |  34 |
| Activity D   |    7 |  34 |
| Activity E=    |    8 |  34 |
| Activity F  = |   12 |  34 |
|--------------+------+-----|
| Activi= ty 1   |    9 |  18 |
| Activity 2 &n= bsp; |    2 |  18 |
| Activity 3   | =    4 |  18 |
| Activity 4   |    3 |  18 |
|-----------= ---+------+-----|
| Activity I   |   23 | 111 |
|= Activity II  |   51 | 111 |
| Activity III |  = 37 | 111 |
|--------------+------+-----|
|    &n= bsp;         |  166 | &nb= sp;   |
|--------------+------+-----|
#+TBLFM: @>$2 =3D vsum(@<<..@>= >) :: @<<$3..@>>$3 =3D vsum(@-I$2..@+I$2)
 


--
Cecil Westerhof
--001a11c0e85c4e7aaa04f27549ab--