From: Eric Schulte <schulte.eric@gmail.com>
To: Nick Dokos <ndokos@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Can this table formula be done more efficient
Date: Sun, 08 Jun 2014 09:07:16 -0400 [thread overview]
Message-ID: <8738ffsg6z.fsf@gmail.com> (raw)
In-Reply-To: <87tx7vk482.fsf@gmail.com> (Nick Dokos's message of "Sun, 08 Jun 2014 07:53:01 -0400")
Nick Dokos <ndokos@gmail.com> writes:
> Cecil Westerhof <cldwesterhof@gmail.com> writes:
>
>> At the moment I am using the following formula:
>> #+TBLFM: @<<$4..@>>$4 = $2 - $3 :: @>$2=vsum(@<<$2..@>>$2) ::
>> @>$3=vsum(@<<$3..@>>$3) :: @>$4=vsum(@<<$4..@>>$4)
>>
>> This does what I want, but there are two things that could be improved.
>>
>> - The second, third and fourth formula do exactly the same, only on
>> different columns. Could this be rewritten to one formula?
>>
>
> --8<---------------cut here---------------start------------->8---
> #+TBLFM: @<<$4..@>>$4 = $2 - $3 :: @>$2..$4=vsum(@<<$0..@>>$0)
> --8<---------------cut here---------------end--------------->8---
>
> See (info "(org) References")
>
>> - The line becomes long and hard to evaluate for a person. Is there
>> a possibility to put the formulas below each-other?
>>
>
> I don't believe so but my belief may be out of date. It has been
> discussed before: check the list archives.
Sort of but not really. See "Using multiple #+TBLFM lines" in the
manual.
,----
| Using multiple #+TBLFM lines
| ............................
|
| You may apply the formula temporarily. This is useful when you switch
| the formula. Place multiple ‘#+TBLFM’ lines right after the table, and
| then press ‘C-c C-c’ on the formula to apply. Here is an example:
|
| | x | y |
| |---+---|
| | 1 | |
| | 2 | |
| #+TBLFM: $2=$1*1
| #+TBLFM: $2=$1*2
|
| Pressing ‘C-c C-c’ in the line of ‘#+TBLFM: $2=$1*2’ yields:
|
| | x | y |
| |---+---|
| | 1 | 2 |
| | 2 | 4 |
| #+TBLFM: $2=$1*1
| #+TBLFM: $2=$1*2
|
| Note: If you recalculate this table (with ‘C-u C-c *’, for example), you
| will get the following result of applying only the first ‘#+TBLFM’ line.
|
| | x | y |
| |---+---|
| | 1 | 1 |
| | 2 | 2 |
| #+TBLFM: $2=$1*1
| #+TBLFM: $2=$1*2
`----
--
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D (see https://u.fsf.org/yw)
next prev parent reply other threads:[~2014-06-08 13:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-08 10:19 Can this table formula be done more efficient Cecil Westerhof
2014-06-08 11:53 ` Nick Dokos
2014-06-08 13:07 ` Eric Schulte [this message]
2014-06-09 7:06 ` Cecil Westerhof
2014-06-09 7:04 ` Cecil Westerhof
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8738ffsg6z.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=ndokos@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).