I am trying something again, after checking many posts. Nobody seems to be able to solve it.
In the journal I enter this:
Meeting 1 #customer1
- text
- TODO action 1
- TODO action 2
Meeting 2 #customer2
- text
- TODO action 3
- TODO action 4
Meeting 3
- TODO action 5
Then I want to make a query in the journal template which shows all tasks, grouped by the block header tag. If no tag exists, then all the other tasks can be grouped together. This should result in the output:
#customer1
- TODO action 1
- TODO action 2
#customer 2
- TODO action 3
- TODO action 4
TODO action 5
In many task-apps this is standard behavior. In Logseq entering all in the Journal is great, but sorting the output you want with many tasks per block header tag.
Currently I use this query, which doesn’t group the tasks per block header tag and doesn’t display the tag:
#+BEGIN_QUERY
{:title "🔨 NOW, TODO or DOING"
:query [:find (pull ?h [*])
:in $ ?start ?today
:where
[?h :block/marker ?marker]
[(contains? #{"NOW" "TODO" "DOING"} ?marker)]
[?h :block/page ?p]
[?p :block/journal? true]
[?p :block/journal-day ?d]
[(>= ?d ?start)]
[(<= ?d ?today)]]
:inputs [:9999d :yesterday]
:result-transform (fn [result]
(sort-by (fn [h]
(get h :block/priority "Z")) result))
:group-by-page? true
:breadcrumb-show? true
:collapsed? false}
#+END_QUERY
Has anyone solved this? I am convinced that it must be possible.