Hiding parents of tasks with future start dates


#1

I apologize if this has been answered elsewhere, but I can’t find it. I’m looking to display all tasks except those that have a start date in the future. If a task isn’t shown, and it has a parent task, I’d also like to hide the parent task.

I have some projects set up like this [edit: I couldn’t get this post to format correctly, but each Task should be indented below the Project above it, and each Subtask below should be indented below the Task immediately above it):

Project A:
– Task 1
— subtask A
–Task 2
— subtask B @start(2016-12-25)

I’ve used this search:
//not (@done or (@start < today + 24h))

That search successfully hides subtask B, but still shows Task 2. Is there a search parameter to use to hide Task 2?

(I know “hide” is probably the wrong term since something “hidden” just isn’t returned in the search results, but I thought it was less confusing to explain it that way)


#2

TLDR;

* except (@done///* union ((@start < [d] today + 24h) union (@start < [d] today + 24h)/..*))

There is a way. It is kind of complicated. I think I have a post or two on the method to my madness. I think that these are posts. Only read them after understanding this post.

Looking for notes with no children.
Unexpected Query
Question about paths

Here is what I would do. If you have no interest on the process, just read the TLDR and get the query. I am placing this here for those who might later have a similar question.

  1. Create a new document with the example you posted above. Maybe make it a little bit more complicated just to make things more interesting and understand what is going on :wink:

  2. Now you would like to get the opposite. You want to get the tasks that have children with certain date.

Here is where the “Axes” section in the documentation come into place. Read them, I know that you will not “understand” them completely, but it might help. Start with what you already wrote, but you need to remember that in order to have TaskPaper compare something as a date instead of as a text, you need to add the modifier [d].

(@start < [d] today + 24h)

Now, you can see that you are seeing the “parent” because you are looking at the “children”, but since what you want to eliminate from your query is the “parent” that has a “particular child”, then just do something like this.

(@start < [d] today + 24h)/..*

Now that you have exactly what you don’t want, you can work backward.

  1. Build your query.

There is a different between “or” and “union”. In this case, “union” is what you want to do. The same applies to “not” and “except”. This is already too much for some people, but I if you need to understand this, I would again refer you to the documentation. Anyhow, your next step is making the query.

A. Since we are starting with “except”, you also need a “*”. Something like,

* except ...

B. Next, since you don’t tasks that are done (I would recommend using the ///* at the end of the tag instead of // at the beginning of it. There are some other posts that explain that), add that to the query

* except @done///*

C. Then add the dates you don’t want to see. In your example it would be something like,

* except (@done///* union (@start < [d] today + 24h))

D. Finally, I would add the parent(s) of the tasks with your date.

* except (@done///* union ((@start < [d] today + 24h) union (@start < [d] today + 24h)/..*))

This will automatically hide the parents that ONLY have tasks with your (@start < [d] today + 24h). This is because of how the search engine works. Hope that this helps.


#3

Thank you for both the search, and the explanation, Victor. The search works perfectly. Over the coming days/weeks, I’ll be educating myself to make sense of how it all works.


#4

I think I spoke to soon. I have some things that aren’t appearing in that search, that seem like they should. I’ve copied and pasted one of the projects and tasks verbatim, changing names and dollar amounts for privacy sake. This one isn’t appearing, even with start dates of today or earlier.

Communicate offers:
- Jones - $100 on 2016-12-15 @start(2016-12-16)
- Smith - $150 @start(2016-12-19)


#5

Hahaha. I completely missed it at first and then when I was making my searches, I figure that your query was being processed by something Jesse had implemented recently. Here is the mistake.

When looking for dates, you need to add the [d] so that the engine parses that info into dates. It is in the documentation somewhere. Just add that to your search. Tell me if that works. I will modify my explanation to include that.

* except (@done///* union ((@start < [d] today + 24h) union (@start < [d] today + 24h)/..*))


#6

I replaced my search with the new search in your last message, and unfortunately I still have the same items not appearing (that should be appearing). Thank you for replying, though.


#7

Mmm… I tested the search on my mocked document. It works as expected. Have you been through the logic of your query? According to what you wanted, you only want to show tasks that are NOT due a certain date. The date being [d] today +24hr.

The communicating offers above are not supposed to show right? Because they are not “starting” 24 hours after today. Now, if you change one of the days to tomorrow @start(2016-12-20), it shows. Right?


#8

I did a lousy job explaining this. I want to hide (not show) future start dates. So, the items above, with a start date of today or in the past, I do want to see. I don’t want to see thing that I’ve deferred into the future. I only want to see things with no start date, or with a start date of today or in the past. I hope that makes sense.


#9

If you want to hide things that start before today, then do < [d] today. If you want to hide things that start after today, then do >[d] today. Check my date primer if that helps.

Primer on using dates.


#10

Thank you very much, Victor. Switching to > did the trick, as I only wanted to see what was available to do today (i.e., I didn’t want to see anything with a future start date). Ironically, the greater than/less than syntax was one part of the search I did understand, but my head was swimming trying to get a grasp on the rest of syntax, so I just missed it in this instance.


#11

One clarification - when switching to “>”, I had to delete the +24h part so that tasks with a start day 1 day in advance weren’t show. So my final search is this:

* except (@done///* union ((@start > [d] today) union (@start > [d] today)/..*))