emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer Hansen <rainer.hansen@gmx.net>
To: emacs-orgmode@gnu.org
Subject: How to calculate sum of property in tree?
Date: Sat, 23 Apr 2016 11:22:18 +0200	[thread overview]
Message-ID: <87a8kkaddh.fsf@gmx.net> (raw)

Hi,

I would like Emacs to calculate the price for the travel cost
(21.90). This should be calculated as sum of the values of the property
"Price" in the elements of the tree. How do I do that in Emacs Lisp?

----------------------------------------------
* Travel cost -- 21.90 EUR

** Train Eusirchen -- Bonn, src_emacs-lisp{(org-entry-get (point) "Price")} EUR 
   :PROPERTIES:
   :Price:    7.70
   :END:
** Bus Euskirchen -- Stotzheim, src_emacs-lisp{(org-entry-get (point) "Price")} EUR
   :PROPERTIES:
   :Price:    2.40
   :END:

** Taxi Bonn, src_emacs-lisp{(org-entry-get (point) "Price")} EUR
   :PROPERTIES:
   :Price:    11.80
   :END:
----------------------------------------------

Thanks!

Rainer

             reply	other threads:[~2016-04-23  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23  9:22 Rainer Hansen [this message]
2016-04-24  9:11 ` How to calculate sum of property in tree? Rainer Hansen

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=87a8kkaddh.fsf@gmx.net \
    --to=rainer.hansen@gmx.net \
    --cc=emacs-orgmode@gnu.org \
    /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).