From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uwe Brauer Subject: table, calc, reorder and protect calculation in one cell Date: Tue, 11 Jun 2019 11:35:09 +0200 Message-ID: <87blz4qxbm.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:43662) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hadBa-0007Re-0Q for emacs-orgmode@gnu.org; Tue, 11 Jun 2019 05:35:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hadBZ-00017Q-14 for emacs-orgmode@gnu.org; Tue, 11 Jun 2019 05:35:21 -0400 Received: from [195.159.176.226] (port=42548 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hadBY-000162-Q6 for emacs-orgmode@gnu.org; Tue, 11 Jun 2019 05:35:20 -0400 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hadBW-000i3C-F2 for emacs-orgmode@gnu.org; Tue, 11 Jun 2019 11:35:18 +0200 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" To: emacs-orgmode@gnu.org Hi I have the following problem This is my original table The row starting with smith is calculated differently from the other two * Orginal #+begin_src | name | C1 | C2 | Res | |--------+----+----+-----| | Adams | 5 | 5 | 10 | | Miller | 6 | 2 | 8 | | Smith | 9 | 1 | 1.7 | ,#+TBLFM: $4=$3+$2::@4$4=0.1*@4$2+0.8*@4$3 #+end_src Now I reorder the table using the column C1 * Original reordered #+begin_src | name | C1 | C2 | Res | |--------+----+----+-----| | Smith | 9 | 1 | 10 | | Miller | 6 | 2 | 8 | | Adams | 5 | 5 | 4.5 | ,#+TBLFM: $4=$3+$2::@4$4=0.1*@4$2+0.8*@4$3 #+end_src Everything looks fine, however when I recalculate the table calc follows its definition and I obtain * Original reordered recalculated #+begin_src | name | C1 | C2 | Res | |--------+----+----+-----| | Smith | 9 | 1 | 10 | | Miller | 6 | 2 | 8 | | Adams | 5 | 5 | 4.5 | ,#+TBLFM: $4=$3+$2::@4$4=0.1*@4$2+0.8*@4$3 #+end_src Which is not what I want. So the question is this. Is there any way to enhance the ordering of rows so that it is reflected in the way the rows a calculated I mean reordering should/could have produced * Original reordered TBLFM changed #+begin_src | name | C1 | C2 | Res | |--------+----+----+-----| | Smith | 9 | 1 | 10 | | Miller | 6 | 2 | 8 | | Adams | 5 | 5 | 4.5 | ,#+TBLFM: $4=$3+$2::@2$4=0.1*@2$2+0.8*@2$3 #+end_src Is this behavior possible? When I delete a row or a column, the TBLFM is updated, could that be done for reordering? Thanks Uwe Brauer