Hi There, so in Hint: Nested Tasks in advanced query I showed, how I got the tasks to be added as whole blocks to the advanced query result.
Now, I’ve got the following problem.
Task
Simple queries group the results by pages, the advanced queries don’t do that.
I guess, that’s something to be achieved with :view
, but I did not figure out yet, how.
I tried searching the console log, but there I only found the query itself, not the :view
.
As a comparison, for
#+BEGIN_QUERY
{
:query [
:find (pull ?b [* {:block/_parent ...}])
:in $ ?current-page
:where
[?p :block/name ?current-page]
[?b :block/path-refs ?p]
[?b :block/marker ?marker]
[(contains? #{"TODO" "NOW" "LATER" "DONE" "WAITING"} ?marker)]]
:inputs [:current-page]
:result-transform
(fn [result]
(sort-by
(fn [b] (get b :block/priority "Z"))
(sort-by
(fn [b] (= (get b :block/marker) "DONE") )
result)))}
#+END_QUERY
the output is