Weekly review

How do I search for projects that have no (undone) actions?

Sorry if this has been posted elsewhere, if it was there I couldn’t find it.

Thank you!

I meant to respond some time ago, but lately I have been using my phone to check the forum. This has been posted elsewhere, the problem at times is figuring out how they phrased the question. In this case, this is something included in the manual Searching in Taskpaper. If you are still wondering how to do accomplishing this, here is the simple way to do it.

* except @done

Since I usually like to also exclude the children of everything that is tagged as done, this is how I accomplish this.

* except @done///*

The documentation explains the paths too, but if you want some examples, I can help. Sometimes adding too much complexity too quickly can overwhelm somebody. I tend to take things very literally since English is not my first language, but just in case that is how you were thinking. You can search for Projects (and I am assuming their children elements) except ACTIONS THAT ARE DONE like this,

(@type=project)///* except (@type=task and @done///*)

That means that you are literally looking for projects and their children (that is the ///* part of the query) but you don’t want to see tasks that are done. This query will include projects that are done. It will not search inside notes or tasks that have tasks unless those notes or tasks are inside a project and are therefore children of them.

2 Likes

Thank you Victor, did try this back then, and it answers partially my question, so to be clearer in my requirements :

How do I search for those project that have (1) no tasks or only (1) @done tasks as descendants?
Examples below - the query should return only 1 and 2, but not 3 and 4

1 Project with no task:

2 Project 2:
- task @done
- task @done

3 Project 3:
- task @done
- task

4 Project 4:
- task
- task

Ricardo, I can easily get the OPPOSITE of what you are looking for, but I need to get some help from the big guns to get the opposite from Jesse. If you want to get just the opposite, this is the query,

((project/..* union task///*) except @done///*)

or

((@type/..* union task///*) except @done///*)

@jessegrosjean or @complexpoint, do you have any idea of how to get the opposite result. I tried different things for over an hour and I couldn’t get the result not figure out the logic behind the madness :slight_smile:

There’s a count function that I think you can use for this:

//project count(task not @done) = 0
//@type = project and count(@type = task and not @done) = 0

Looks like I never got around to documenting count or really mentioning it other then here:

I don’t think I’ve documented it, and I’m not really sure what state “count” is in… but it seems that at some point I implemented it :). Basically it evaluates an item path based on the current path node that’s being check and returns the count of results of that path as a string.

2 Likes

Thank you very much. Something new to add to Quiver. But I still cannot solve my question nor the original query. I tried and I couldn’t come up with a result. Are you sure that the following,

//project count(task not @done) = 0
//@type = project and count(@type = task and not @done) = 0

Does this?

How do I search for those project that have (1) no tasks or only (1) @done tasks as descendants?
Examples below - the query should return only 1 and 2, but not 3 and 4

1 Project with no task:

2 Project 2:
	- task @done
	- task @done

3 Project 3:
    - task @done
    - task

4 Project 4:
    - task
    - task

Okay, it took me two minutes to figure it out. The following query will solve @Riccardo’s quest, although it will also include projects that have notes or other projects.

(@type = project and count(@type = task and not @done) = 0)///*

If you only want to do find exactly what you requested, just make sure you are not including the root projects with the following,

/(@type = project and count(@type and not @done) = 0)///*

Will remember to save this in my Quiver files, although now that I found “Typora” I am trying to see if I can convert everything to markdown files. Thank you!

Thank you! That does the job, sorry if I am so beginning of century with my GTD style “weekly review”

2 Likes

I seem to remember that it was born as a way of searching for leaf nodes:

http://support.hogbaysoftware.com/t/how-to-select-nodes-with-no-children/1990/19

Ricardo, have you noticed that some of the themes in the Theme section have some sample searches? I have them in a Quiver file now, but you can find some of those themes useful. Here are the links to the ones I am referring to.

Omnifocus like search tags.
Matt’s theme and searches