Advanced query to exclude or include repeated tasks

  1. I have query which shows all TODO with tag work
{:title "🛫 **TODO**"
 :query (and (task todo) [[work]] )
 :collapsed? true
:result-transform :sort-by-priority}
#+END_QUERY

I would like to exclude repeated tasks from this list.
How I can do it?

  1. And if exclude repeated tasks from query above, I would like to have another query to keep an eye on repeated tasks.
    What will be the query to see repeated TODO and under tag work?

Thank you.

All TODO with tag work, exclude repeated

#+BEGIN_QUERY
{:title "🛫 **TODO**"
:query [:find (pull ?b [*])
     :where
      [task ?b #{"TODO"}]
      (not [?b :block/repeated? true])
      [?b :block/path-refs [:block/name "work"]]
   ]
:collapsed? true}
#+END_QUERY

All repeated TODO with tag work

#+BEGIN_QUERY
{:title "🪃 **TODO Repeated**"
:query [:find (pull ?b [*])
     :where
      [task ?b #{"TODO"}]
      [?b :block/repeated? true]
      [?b :block/path-refs [:block/name "work"]]
   ]
:collapsed? true}
#+END_QUERY

@Siferiax please consider to add it to your collections :smiley_cat:

1 Like

Is there a way to do this and capture all the todos within a namespace? I got your query working, but it finds them across all of LogSeq. I am trying to query them from inside a hierarchy.