Search terms: filtering out branches when child items don't meet the criteria

I’m struggling to get my search terms right, particularly using not with descendents.

I’ve got a task like the below, with a main task with a tag plus some child notes

- consider adding photo support? @someday
	Present up to 3 thumbnails on a sighting, 
    any more then an overlay on 3rd with "tap to show more"
	Q: how to store the link?

I want to be able to filter out the @someday tasks, but using not @someday doesn’t work as I’ve not tagged all the child tasks the same (and on a real-life scale doing so would be impractical) so they force the parent to not be filtered out. I feel like I should be able to do a filter that filters out a branch from wherever a tag appears irrespective of whether child items have that tag or not. Ideally it’d also be great to use an except with it so specific children with certain tags could be included, but that’d just be the cherry on the top!

What am I missing?

I think you want:

not @someday except @someday///*

A bit more info can be found in “Axes” section here. The /// syntax is shortcut for descendant-or-self.

Using quotes you can continue this pattern like (There also might be more elegant search, that’s always the challenge!):

not @someday except (@someday///* except @cherry)
1 Like

That’s it! I knew it was something like that, but struggling to grok the combined logic when combining not, except and ///. I’ll RTFM again :slight_smile:

Thanks.

2 Likes