From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sankalp Subject: Re: Referring to the Last Row of a Remote Table using @> Date: Fri, 13 Jan 2012 07:47:10 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec54ee96494f15504b65f7726 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlWhy-0001Ek-3s for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 21:17:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlWhw-00065Y-Ak for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 21:17:34 -0500 Received: from mail-vx0-f169.google.com ([209.85.220.169]:49720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlWhw-00065U-3i for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 21:17:32 -0500 Received: by vcbf1 with SMTP id f1so26403vcb.0 for ; Thu, 12 Jan 2012 18:17:31 -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 --bcaec54ee96494f15504b65f7726 Content-Type: text/plain; charset=ISO-8859-1 Here's a screenshot, for those who cannot see the table spacing properly in the email http://imgur.com/4W75H ------- Sankalp On 13 January 2012 07:42, Sankalp wrote: > 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 > --bcaec54ee96494f15504b65f7726 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Here's a screenshot, for those who ca= nnot see the table spacing properly in the email


-------
Sankalp


On 13 January 2012 07:42, Sankalp <sankalpkhare@gmai= l.com> wrote:
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


--bcaec54ee96494f15504b65f7726--