From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sankalp Subject: Referring to the Last Row of a Remote Table using @> Date: Fri, 13 Jan 2012 07:42:26 +0530 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf307f33a0a70c4804b65f661a Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlWdN-0007Xq-7D for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 21:12:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlWdM-0005SU-46 for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 21:12:49 -0500 Received: from mail-vx0-f169.google.com ([209.85.220.169]:41380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlWdM-0005SO-0s for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 21:12:48 -0500 Received: by vcbf1 with SMTP id f1so24280vcb.0 for ; Thu, 12 Jan 2012 18:12:47 -0800 (PST) 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 --20cf307f33a0a70c4804b65f661a Content-Type: text/plain; charset=ISO-8859-1 Hi, I have the following situation : #+TBLNAME: Totals |--------+--------| | Name | Amount | |--------+--------| | xyz | 90 | *<-- should evaluate to 130, not 90* |--------+--------| | TOTAL | | |--------+--------| #+TBLFM: @2$2=remote(xyz,@>$4) *<-- I'm trying to refer to the last row, 4th column in table xyz* #+TBLNAME: xyz |----------------+----------------------+------------------+--------| | Title | Description | Date | Amount | |----------------+----------------------+------------------+--------| | Trichy Tickets | Trichy Gig Travel | | 1200 | | PAID | | [2011-10-16 Sun] | -1000 | | Blah | Prior to Inorbit Gig | [2011-11-11 Fri] | 90 | | InOrbit Money | Payment for Gig | [2011-11-11 Fri] | -200 | | Biryani | Al-Saba | [2012-01-07 Sat] | 120 | | Sub | Chicken Ham | [2012-01-12 Thu] | -75 | | Blah | I had asdad | [2012-01-12 Thu] | -5 | |----------------+----------------------+------------------+--------| | TOTAL | | | 130 | |----------------+----------------------+------------------+--------| #+TBLFM: $4=vsum(@2..@-1) Instead of showing 130, the formula in the "Totals" table is showing 90. Upon some investigation, it becomes apparent that even though the formula * should* point to the last row in the remote table (value 130), "@>" in the remote table reference is actually evaluating to "@3" (since the current table has 3 rows) instead of evaluating to "@9" as expected (since the remote table has 9 rows). Is this a bug? or am I making some mistake in the formula. ------- Sankalp --20cf307f33a0a70c4804b65f661a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,
I have the following situation :

#+= TBLNAME: Totals
|--------+-------= -|
| Name = =A0 | Amount |
|--------+--------|
| xyz =A0 =A0| =A0 =A0= 90 | =A0<-- should evaluat= e to 130, not 90
|--------+--------|
| TOTAL =A0| =A0 =A0 = =A0 =A0|
|= --------+--------|
#+TBLFM: @2$2=3Dremote(xyz,@>$4) =A0<-- I'm trying to refer to the last row, 4th colum= n in table xyz

=
#+TBLNAME: xyz
|-----------= -----+----------------------+------------------+--------|
| Title =A0 =A0 = =A0 =A0 =A0| Description =A0 =A0 =A0 =A0 =A0| Date =A0 =A0 =A0 =A0 =A0 =A0 = | Amount |
= |----------------+----------------------+------------------+--------|
| Trichy Tickets= | Trichy Gig Travel =A0 =A0| =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 1200= |
| PAID = =A0 =A0 =A0 =A0 =A0 | =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| [2011-10= -16 Sun] | =A0-1000 |
| Blah =A0 =A0 = =A0 =A0 =A0 | Prior to Inorbit Gig | [2011-11-11 Fri] | =A0 =A0 90 |
<= div style=3D"font-family:'courier new',monospace">| InOrbit Money = =A0| Payment for Gig =A0 =A0 =A0| [2011-11-11 Fri] | =A0 -200 |
| Biryani =A0 = =A0 =A0 =A0| Al-Saba =A0 =A0 =A0 =A0 =A0 =A0 =A0| [2012-01-07 Sat] | =A0 = =A0120 |
| = Sub =A0 =A0 =A0 =A0 =A0 =A0| Chicken Ham =A0 =A0 =A0 =A0 =A0| [2012-01-12 T= hu] | =A0 =A0-75 |
| Blah =A0 =A0 = =A0 =A0 =A0 | I had asdad =A0 =A0 =A0 =A0 =A0| [2012-01-12 Thu] | =A0 =A0 -= 5 |
|------= ----------+----------------------+------------------+--------|
| TOTAL =A0 =A0 = =A0 =A0 =A0| =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0| =A0 =A0130 |
|----------------+----------------------+-----------= -------+--------|
#+TBLFM: $4=3Dvsum(@2.= .@-1)
Instead of showing 130,= the formula in the "Totals" table is showing 90.

Upon some investigation,=A0it becomes apparent that even though the formul= a should=A0point to the last row in the remote = table
(value 130), "@>"= ; in the remote table reference is actually evaluating to "@3" (s= ince the current=A0ta= ble has 3 rows) instead
of evaluating to "= @9" as expected (since the remote table has 9 rows).
=
Is this a bug? or am I making some mistake in the formula.=

-------
Sankalp
=
--20cf307f33a0a70c4804b65f661a--