emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Referring to the Last Row of a Remote Table using @>
@ 2012-01-13  2:12 Sankalp
  2012-01-13  2:17 ` Sankalp
  0 siblings, 1 reply; 3+ messages in thread
From: Sankalp @ 2012-01-13  2:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 4376 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Referring to the Last Row of a Remote Table using @>
  2012-01-13  2:12 Referring to the Last Row of a Remote Table using @> Sankalp
@ 2012-01-13  2:17 ` Sankalp
  2012-01-13  3:25   ` Sankalp
  0 siblings, 1 reply; 3+ messages in thread
From: Sankalp @ 2012-01-13  2:17 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2033 bytes --]

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 <sankalpkhare@gmail.com> 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
>

[-- Attachment #2: Type: text/html, Size: 5115 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Referring to the Last Row of a Remote Table using @>
  2012-01-13  2:17 ` Sankalp
@ 2012-01-13  3:25   ` Sankalp
  0 siblings, 0 replies; 3+ messages in thread
From: Sankalp @ 2012-01-13  3:25 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2349 bytes --]

Hi,
Just saw this : http://thread.gmane.org/gmane.emacs.orgmode/50991

Apologies for initiating a new thread when the issue was already being
discussed.

Sincerely,
-------
Sankalp


On 13 January 2012 07:47, Sankalp <sankalpkhare@gmail.com> wrote:

> 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 <sankalpkhare@gmail.com> 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
>>
>
>

[-- Attachment #2: Type: text/html, Size: 6123 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-13  3:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-13  2:12 Referring to the Last Row of a Remote Table using @> Sankalp
2012-01-13  2:17 ` Sankalp
2012-01-13  3:25   ` Sankalp

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).