emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Formulas in columnview table
@ 2009-02-03 13:46 Flávio
  2009-02-03 15:13 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Flávio @ 2009-02-03 13:46 UTC (permalink / raw)
  To: emacs-orgmode

I am using columnview table now to get some summaries of worked hours and
quantity balance as well. This is one example showing a quantity of quoted
computers and the real sold quantity:

|   | ITEM                    | Quotation | Sold | 
|---+-------------------------+-----------+------+
|   | ** Computers            |      10   |  7   |
|---+-------------------------+-----------+------+

Is there any way to automatically insert a fórmula in a third column? For
example, I could insert a "Difference" column and make Sold - Quotation and get
this result:

|   | ITEM                    | Quotation | Sold | Difference |
|---+-------------------------+-----------+------+------------|
|   | ** Computers            |      10   |  7   |     -3     |
|---+-------------------------+-----------+------+------------|

So I could change the column defintion from:
:COLUMNS:  %50ITEM %10Quoted(Quotation){+} %10Sold(Sold){+}


To:
 
:COLUMNS:  %50ITEM %10Quoted(Quotation){+} %10Sold(Sold){+}
%10Sold-Quoted(Difference)
 
Maybe I am going too far with tables and columns view and the  developers did
not intend this kind of feature because of complexity. 
But I think this would be a great feature.

Regards,

Flávio

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

* Re: Formulas in columnview table
  2009-02-03 13:46 Formulas in columnview table Flávio
@ 2009-02-03 15:13 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2009-02-03 15:13 UTC (permalink / raw)
  To: Flávio; +Cc: emacs-orgmode

Flávio <flaviostz@gmail.com> writes:

> I am using columnview table now to get some summaries of worked hours and
> quantity balance as well. This is one example showing a quantity of quoted
> computers and the real sold quantity:
>
> |   | ITEM                    | Quotation | Sold | 
> |---+-------------------------+-----------+------+
> |   | ** Computers            |      10   |  7   |
> |---+-------------------------+-----------+------+
>
> Is there any way to automatically insert a fórmula in a third column? For
> example, I could insert a "Difference" column and make Sold - Quotation and get
> this result:
>
> |   | ITEM                    | Quotation | Sold | Difference |
> |---+-------------------------+-----------+------+------------|
> |   | ** Computers            |      10   |  7   |     -3     |
> |---+-------------------------+-----------+------+------------|
>

org-collector is useful when you want to perform calculations on
properties *before* they are entered into a columnview type table.
Using org-collector a dblock like the following should work.

#+BEGIN: propview :cols (ITEM Quoted Sold (- Sold Quoted))
#+END:

The downside of org-collector is that it is not really part of org-mode,
and it doesn't have many of the nice features of columnview tables, like
the specification of column titles.  You can grab a copy of
org-collector.el from here
http://github.com/eschulte/org-contrib/raw/df909c94083b882d9a0f703a4314e0342dc5343f/org-collector.el

Cheers -- Eric

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

end of thread, other threads:[~2009-02-03 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-03 13:46 Formulas in columnview table Flávio
2009-02-03 15:13 ` Eric Schulte

Code repositories for project(s) associated with this 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).