Query sort by the page that they are grouped for

Hi colleagues!
I have this query that works well BUT the results are not sorted well alfabetically by the page that they are grouped for.
What I’m missing here?

#+BEGIN_QUERY
{:title [:h2 "Anytime"]
 :query [:find (pull ?b [*])
         :where
         [?b :block/marker ?marker]
         [(contains? #{"LATER"} ?marker)]
         [?b :block/page ?p]]
 :columns [:block/marker :block/content :block/page]
 :breadcrumb-show? false
 :group-by-page? true
 :result-transform (fn [result]
                     (sort-by (fn [group]
                                (clojure.string/lower-case
                                  (or (-> group :page :name)
                                      (-> group :page :block/name)
                                      "")))
                              result))}
#+END_QUERY
1 Like
1 Like