Hi everyone. I am a new user.
I noticed that if I used a query without SORT-BY. The results will be merged by the common parent block like this:
The code is:
#+BEGIN_QUERY
{:title [:h1 "⌚️ next 10 days' deadline or schedule"]
:query [:find (pull ?block [*])
:in $ ?start ?next
:where
(or
[?block :block/scheduled ?d]
[?block :block/deadline ?d])
[(> ?d ?start)]
[(< ?d ?next)]]
:inputs [:today :+10d]
:collapsed? false}
#+END_QUERY
However if I used result-transform to sort the results. They will have the same parent block appearing many times.
The code is:
#+BEGIN_QUERY
{:title [:h1 "✅ Planned"]
:query [:find (pull ?b [*])
:where
[?b :block/marker ?marker]
[(contains? #{"TODO" "LATER"} ?marker)]
[?b :block/scheduled ?d]
]
:result-transform (fn [result] (sort-by (fn [r] (get-in r [:block/scheduled])) result)) ; sort the result by the scheduled date
}
#+END_QUERY
You can see many 203B in this picture. How to merge them? Thanks!