0

I have multiple headlines with two Properties A and B, storing the numerical values 0, 1, 2, 3, e.g.:

* Headline
:PROPERTIES:
:A: 2
:B: 3
:END:

I want to create a sparse tree based on the values stored in A and B.

For example, I want to be able to create a sparse tree containing all headlines where A=2 and B=3.

I know that you can filter for a single property and its value with C-c / p.

But is there a way to do that for two or more properties and their respective values at the same time?

1 Answer 1

1

Yes, you can! org-mode has a slightly mixed language, around the words "tag" and "match", but you can use C-c / m. See the documentation for exactly how it works - https://orgmode.org/manual/Matching-tags-and-properties.html (you want to pay attention around +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2+With={Sarah\|Denny}+SCHEDULED>="<2008-10-11>")

but in your case for instance, A=2&B=3 would work, so it could be (org-match-sparse-tree nil "A=2&B=3") or C-c / m A=2&B=3 RET.

2
  • Thank you @Trevoke! The first expression (A=2&B=3) works exactly as I want it to. However, there seems to be an issue with the second one ("A=\"2\"&B=\"3\"): when I use it, all headlines in the sparse tree become visible. Furthermore, the second expression seems a bit complicated and also involves quite a bit of typing.Is it possible to make life easier here, for instance, by predefining certain expressions or storing them within a function?
    – GNUmon
    Commented Aug 16, 2023 at 12:53
  • 1
    Let's assume I'm wrong about the second one for now then, I'll edit my answer and remove that. As for your question, you should make a separate question out of that, because there may be multiple answers, e.g. creating a custom agenda view :)
    – Trevoke
    Commented Aug 16, 2023 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.