emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Table equations: II on lhs
@ 2010-02-01 17:08 Kim Toms
  2010-02-01 18:58 ` Russell Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Kim Toms @ 2010-02-01 17:08 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 668 bytes --]

I am using a simple table to add up some estimates for tasks.  On the left
hand side of the equations in the TBLFM line I can't get an expression like
@II$2 to work.

Here's an example
| task  | estimate | probable |
|-------+----------+----------|
| one   |       12 |        2 |
| two   |       10 |        3 |
|-------+----------+----------|
| total |       22 |        5 |
#+TBLFM: @4$2=vsum(@I..@II-1)::@4$3=vsum(@I..@II-1)

I'd like to be able to put @II$2 on the LHS of the equation.  That way, when
I add a row to the table, the equation doesn't have to change.

A workaround for the above table is to use $LR2 and $LR3 instead of the more
general references.

[-- Attachment #1.2: Type: text/html, Size: 1618 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Table equations: II on lhs
  2010-02-01 17:08 Table equations: II on lhs Kim Toms
@ 2010-02-01 18:58 ` Russell Adams
  2010-02-02 14:08   ` Kim Toms
  0 siblings, 1 reply; 3+ messages in thread
From: Russell Adams @ 2010-02-01 18:58 UTC (permalink / raw)
  To: emacs-orgmode

On Mon, Feb 01, 2010 at 12:08:20PM -0500, Kim Toms wrote:
> I am using a simple table to add up some estimates for tasks.  On the left
> hand side of the equations in the TBLFM line I can't get an expression like
> @II$2 to work.
> 
> Here's an example
> | task  | estimate | probable |
> |-------+----------+----------|
> | one   |       12 |        2 |
> | two   |       10 |        3 |
> |-------+----------+----------|
> | total |       22 |        5 |
> #+TBLFM: @4$2=vsum(@I..@II-1)::@4$3=vsum(@I..@II-1)
> 
> I'd like to be able to put @II$2 on the LHS of the equation.  That way, when
> I add a row to the table, the equation doesn't have to change.
> 
> A workaround for the above table is to use $LR2 and $LR3 instead of the more
> general references.

I do this fairly often. Just use enter to add a row in the table, the
references are automatically updated. Now, if you copy and paste it
won't work.

I just tried your example with the LR, and that worked fine for me.

|-------+----------+----------|
| task  | estimate | probable |
|-------+----------+----------|
| one   |       12 |        2 |
| two   |       10 |        3 |
| three |        8 |        8 |
| three |        8 |        8 |
| three |        8 |        8 |
| three |        8 |        8 |
|-------+----------+----------|
| total |       54 |       37 |
|-------+----------+----------|
#+TBLFM: $LR2=vsum(@-I..@-II)::$LR3=vsum(@-I..@-II)

This isn't copy/paste sensitive at all.

Does that answer your question?

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

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

* Re: Table equations: II on lhs
  2010-02-01 18:58 ` Russell Adams
@ 2010-02-02 14:08   ` Kim Toms
  0 siblings, 0 replies; 3+ messages in thread
From: Kim Toms @ 2010-02-02 14:08 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2196 bytes --]

Hm.  I hadn't noticed that; thanks!

On Mon, Feb 1, 2010 at 1:58 PM, Russell Adams <RLAdams@adamsinfoserv.com>wrote:

> On Mon, Feb 01, 2010 at 12:08:20PM -0500, Kim Toms wrote:
> > I am using a simple table to add up some estimates for tasks.  On the
> left
> > hand side of the equations in the TBLFM line I can't get an expression
> like
> > @II$2 to work.
> >
> > Here's an example
> > | task  | estimate | probable |
> > |-------+----------+----------|
> > | one   |       12 |        2 |
> > | two   |       10 |        3 |
> > |-------+----------+----------|
> > | total |       22 |        5 |
> > #+TBLFM: @4$2=vsum(@I..@II-1)::@4$3=vsum(@I..@II-1)
> >
> > I'd like to be able to put @II$2 on the LHS of the equation.  That way,
> when
> > I add a row to the table, the equation doesn't have to change.
> >
> > A workaround for the above table is to use $LR2 and $LR3 instead of the
> more
> > general references.
>
> I do this fairly often. Just use enter to add a row in the table, the
> references are automatically updated. Now, if you copy and paste it
> won't work.
>
> I just tried your example with the LR, and that worked fine for me.
>
> |-------+----------+----------|
> | task  | estimate | probable |
> |-------+----------+----------|
> | one   |       12 |        2 |
> | two   |       10 |        3 |
> | three |        8 |        8 |
> | three |        8 |        8 |
> | three |        8 |        8 |
> | three |        8 |        8 |
> |-------+----------+----------|
> | total |       54 |       37 |
> |-------+----------+----------|
> #+TBLFM: $LR2=vsum(@-I..@-II)::$LR3=vsum(@-I..@-II)
>
> This isn't copy/paste sensitive at all.
>
> Does that answer your question?
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

[-- Attachment #1.2: Type: text/html, Size: 2944 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-02-02 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01 17:08 Table equations: II on lhs Kim Toms
2010-02-01 18:58 ` Russell Adams
2010-02-02 14:08   ` Kim Toms

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).