From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: [bug] spreadsheet does not replace some fields Date: Fri, 24 Aug 2012 19:49:34 +0200 Message-ID: References: <20120620134758.GB2280@soloJazz.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=bcaec54ee62c546d5404c806993d Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4y0o-0004Li-E3 for emacs-orgmode@gnu.org; Fri, 24 Aug 2012 13:49:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4y0n-0001Le-3k for emacs-orgmode@gnu.org; Fri, 24 Aug 2012 13:49:38 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:34381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4y0m-0001LV-Nw for emacs-orgmode@gnu.org; Fri, 24 Aug 2012 13:49:37 -0400 Received: by lbon3 with SMTP id n3so1320773lbo.0 for ; Fri, 24 Aug 2012 10:49:34 -0700 (PDT) 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: Org Mode --bcaec54ee62c546d5404c806993d Content-Type: text/plain; charset=ISO-8859-1 Hi all On Wed, Jun 20, 2012 at 10:53 PM, Michael Brand wrote: > On Wed, Jun 20, 2012 at 3:47 PM, Juan Pechiar wrote: >> From the manual (section 3.5.6 Column Formulas): >> >> If the table contains horizontal separator hlines, everything before >> the first such line is considered part of the table header and will >> not be modified by column formulas. > > Yes, of course, I should know! I read this some years ago but didn't > realize then what effect it will have for me one day: All rows in my > current example except the last one are just considered as the table > header and everything becomes clear. How could I not conclude myself. > Thank you for helping out. > > With this in mind it should be > > | item | absolute | percent | > |-------+----------+---------| > | a | 17 | 34 | > | b | 21 | 42 | > | c | 12 | 24 | > |-------+----------+---------| > | total | 50 | 100 | > #+TBLFM: @>$2=vsum(@<<$2..@>>$2)::$3=100 * $2 / @>$2 > > or > > |-------+----------+---------| > | item | absolute | percent | > |-------+----------+---------| > | a | 17 | 34 | > | b | 21 | 42 | > | c | 12 | 24 | > |-------+----------+---------| > | total | 50 | 100 | > |-------+----------+---------| > #+TBLFM: @>$2=vsum(@<<$2..@>>$2)::$3=100 * $2 / @>$2 > > and it is not possible to take the shortcut of > > | a | 17 | | > | b | 21 | | > | c | 12 | | > |-------+----+-----| > | total | 50 | 100 | > #+TBLFM: @>$2=vsum(@<$2..@>>$2)::$3=100 * $2 / @>$2 > > or > > |-------+----+-----| > | a | 17 | | > | b | 21 | | > | c | 12 | | > |-------+----+-----| > | total | 50 | 100 | > |-------+----+-----| > #+TBLFM: @>$2=vsum(@<$2..@>>$2)::$3=100 * $2 / @>$2 > > to group rows with hline To make this clearer in the manual I suggest the attached small patch. Michael --bcaec54ee62c546d5404c806993d Content-Type: text/plain; charset=US-ASCII; name="0001-org.texi-Mention-when-a-table-header-is-mandatory.patch.txt" Content-Disposition: attachment; filename="0001-org.texi-Mention-when-a-table-header-is-mandatory.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h69kqqlx0 RnJvbSAxZjljYzA4ZWNhZDZlN2Y3OGY0NDA4NGYwZDAwMTIwM2YwNDEwNGE3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoYWVsIEJyYW5kIDxtaWNoYWVsLmNoLmJyYW5kQGdtYWls LmNvbT4KRGF0ZTogRnJpLCAyNCBBdWcgMjAxMiAxOTo0Njo0OSArMDIwMApTdWJqZWN0OiBbUEFU Q0hdIG9yZy50ZXhpOiBNZW50aW9uIHdoZW4gYSB0YWJsZSBoZWFkZXIgaXMgbWFuZGF0b3J5Cgoq IG9yZy50ZXhpIChDb2x1bW4gZm9ybXVsYXMpOiBBZGQg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