Hi
I have a search query which will pull up scheduled events in chronological order:
#+BEGIN_QUERY
{:title [:h3 "Scheduled events - next 1000 days"]
:query [:find (pull ?block [*])
:in $ ?start ?next
:where
(or
[?block :block/scheduled ?d]
[?block :block/deadline ?d])
[(>= ?d ?start)]
[(<= ?d ?next)]]
:result-transform (fn [result]
(sort-by (fn [d]
(get d :block/scheduled) (get d :block/scheduled) ) result))
:inputs [:8d-after :1000d-after]
:collapsed? false}
#+END_QUERY
I am trying to manipulate this query so that it only shows scheduled events tagged with the name of the current page.
Here is my first attempt, but it doesn’t do what it’s supposed to do
#+BEGIN_QUERY
{:title [:h3 "Scheduled events over next 1000 days tagged with current page"]
:query [:find (pull ?block [*])
:in $ ?start ?next ?current-page
:where
[?p :block/name ?current-page]
(or
[?block :block/scheduled ?d]
[?block :block/deadline ?d]
)
[(>= ?d ?start)]
[(<= ?d ?next)]]
:result-transform (fn [result]
(sort-by (fn [d]
(get d :block/scheduled) (get d :block/scheduled) ) result))
:inputs [:0d-after :1000d-after :current-page]
:collapsed? false}
#+END_QUERY
It pulls up non-scheduled events, and events which are not tagged with current page. Does anyone know where I have gone wrong?
Ta