emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: "Felix H. Dahlke" <fhd@uberco.de>
Cc: emacs-orgmode@gnu.org, info@protesilaos.com
Subject: Re: [BUG] clocktable match doesn't seem to support matching items based on parent property [9.6.15 (release_9.6.15 @ /snap/emacs/current/usr/share/emacs/29.3/lisp/org/)]
Date: Thu, 09 May 2024 11:32:03 +0000	[thread overview]
Message-ID: <874jb7kyq4.fsf@localhost> (raw)
In-Reply-To: <8acdd46f-4137-4957-bb52-827d817eb5e7@uberco.de>

"Felix H. Dahlke" <fhd@uberco.de> writes:

> I want to create a clocktable report for all items under a specific
> heading, using the match keyword and the ITEM property. It appears
> that matching items this way won't include any subheadings, therefore
> not showing their times in the clocktable.

It is expected.
ITEM property is the heading text without stars, todo keyword, priority,
and tags. It has nothing to do with parent headings. So, when you ask
Org mode to match against specific ITEM, it will only include headings
with their own title matching the search criteria for ITEM.

In contrast, tags are inherited by default, so that heading tags include
the local tags and also parent tags.

> Example:
>
> * Level 1                                                   :level_1:
> ** Level 2
> :PROPERTIES:
> :LEVEL:      1
> :END:
>
> *** Level 3
> :LOGBOOK:
> CLOCK: [2024-05-07 Tue 11:00]--[2024-05-07 Tue 12:00] =>  1:00
> :END:
>
> * Report matching the ITEM property doesn't work
> #+BEGIN: clocktable :scope file :match "ITEM=\"Level 1\""
> #+CAPTION: Clock summary at [2024-05-07 Tue 13:00]
> | Headline     | Time   |
> |--------------+--------|
> | *Total time* | *0:00* |
> #+END:

This is expected, because clock data is not calculated in the headlines
that do not match the :match criteria. This includes subtrees.

> * Report matching an arbitrary property doesn't work
> #+BEGIN: clocktable :scope file :match "LEVEL=\"1\""
> #+CAPTION: Clock summary at [2024-05-07 Tue 13:00]
> | Headline     | Time   |
> |--------------+--------|
> | *Total time* | *0:00* |
> #+END:
>
> Note that this _does_ work if ~org-use-property-inheritance~ is not
> ~nil~.

LEVEL is not an arbitrary property. It is headline level. I am not sure
what you got things "work" when you enable property inheritance - not
for LEVEL.

Not a bug.
Canceled.

In future, the plan is to adopt org-ql syntax for matching headlines. It
will be more flexible and allow matching outline-path in addition to
current heading title/ITEM.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


      reply	other threads:[~2024-05-09 11:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 11:12 [BUG] clocktable match doesn't seem to support matching items based on parent property [9.6.15 (release_9.6.15 @ /snap/emacs/current/usr/share/emacs/29.3/lisp/org/)] Felix H. Dahlke
2024-05-09 11:32 ` Ihor Radchenko [this message]

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=874jb7kyq4.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=fhd@uberco.de \
    --cc=info@protesilaos.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).