Why does some advanced query display "No matched results" and some simply don't show >

Hi there, I can’t find out why some of my queries are not shown at all whereas some are displayed with a message No matched result. It is inconsistent.

I should add that I tested and the “invisible” queries work when I create a task that match the filter.

Any idea ? Here are my queries inside my contents file :

- #+BEGIN_QUERY
  {:title [:h3 "🔨 Now"]
  :query [:find (pull ?b [*])
    :where
      [?b :block/marker ?marker]
      [(contains? #{"DOING" "NOW"} ?marker)]  ; Check if the marker is either "DOING" or "NOW"
  ]
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
    (sort-by
      (fn [r]
        [
          (get-in r [:block/deadline] 99991231)
          (get-in r [:block/scheduled] 99991231)
          (get-in r [:block/priority] "Z")
        ]
      ) result)) ; Sort the result by the deadline date, then scheduled date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "☠️ Overdue"]
  :query [:find (pull ?b [*])
    :in $ ?day  ; ?day is the name for the first value in inputs further down.
    :where
      [?b :block/marker ?marker]
      [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
      [?b :block/deadline ?d]  ; The block ?b has attribute deadline with value ?d
      (not [?b :block/repeated? true]) ; The block ?b is not repeated
      [(< ?d ?day)]  ; The value ?d is smaller than the value ?day
  ]
  :inputs [:today]  ; Use the Logseq dynamic variable `:today` as input for this query (gives today's date as yyyymmdd format)
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
    (sort-by
      (fn [r]
        [
          (get-in r [:block/deadline])
          (get-in r [:block/priority] "Z")
        ]
      ) result)) ; Sort the result by the deadline date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔥 Past scheduled"]
  :query [:find (pull ?b [*])
    :in $ ?day  ; ?day is the name for the first value in inputs further down.
    :where
      [?b :block/marker ?marker]
      [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
      [?b :block/scheduled ?d]  ; The block ?b has attribute scheduled with value ?d
      (not [?b :block/repeated? true]) ; The block ?b is not repeated
      [(< ?d ?day)]  ; The value ?d is smaller than the value ?day
  ]
  :inputs [:today]  ; Use the Logseq dynamic variable `:today` as input for this query (gives today's date as yyyymmdd format)
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
    (sort-by
      (fn [r]
        [
          (get-in r [:block/scheduled])
          (get-in r [:block/priority] "Z")
        ]
      ) result)) ; Sort the result by the scheduled date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🆘 Deadline Today"]
  :query [:find (pull ?b [*])
          :in $ ?today
          :where
          [?b :block/marker ?marker]
          [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
          [?b :block/deadline ?d]  ; The block ?b has attribute deadline with value ?d
          (not [?b :block/repeated? true])  ; The block ?b is not repeated
          [(= ?d ?today)]  ; The value ?d is equal to the value ?today
          ]
  :inputs [:today]  ; Use the Logseq dynamic variable `:today` for today's date
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
                      (sort-by
                        (fn [r]
                          [
                          (get-in r [:block/deadline])
                          (get-in r [:block/priority] "Z")
                          ]
                        ) result)) ; Sort the result by the deadline date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🆙 Scheduled Today"]
  :query [:find (pull ?b [*])
          :in $ ?today
          :where
          [?b :block/marker ?marker]
          [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
          [?b :block/scheduled ?d]  ; The block ?b has attribute scheduled with value ?d
          (not [?b :block/repeated? true])  ; The block ?b is not repeated
          [(= ?d ?today)]  ; The value ?d is equal to the value ?today
          ]
  :inputs [:today]  ; Use the Logseq dynamic variable `:today` for today's date
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
                      (sort-by
                        (fn [r]
                          [
                          (get-in r [:block/scheduled])
                          (get-in r [:block/priority] "Z")
                          ]
                        ) result)) ; Sort the result by the scheduled date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔜 Upcoming This Week"]
      :query [:find (pull ?b [*])
              :in $ ?start-day ?end-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/deadline ?d]  ; The block ?b has attribute deadline with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than or equal to the value ?start-day
              [(<= ?d ?end-day)]  ; The value ?d is less than the value ?end-day
              ]
      :inputs [:today :+7d]  ; Use the Logseq dynamic variable `:today` and 7 days in the future
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/deadline])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the deadline date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "📅 Planned This Week"]
      :query [:find (pull ?b [*])
              :in $ ?start-day ?end-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/scheduled ?d]  ; The block ?b has attribute scheduled with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than or equal to the value ?start-day
              [(<= ?d ?end-day)]  ; The value ?d is less than the value ?end-day
              ]
      :inputs [:today :+7d]  ; Use the Logseq dynamic variable `:today` and 7 days in the future
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/scheduled])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the scheduled date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔜 Upcoming This Month"]
      :query [:find (pull ?b [*])
              :in $ ?start-day ?end-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/deadline ?d]  ; The block ?b has attribute deadline with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than the value ?start-day
              [(<= ?d ?end-day)]  ; The value ?d is less than the value ?end-day
              ]
      :inputs [:+7d :+30d]  ; Use the Logseq dynamic variable to start 7 days after today and go up to 30 days
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/deadline])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the deadline date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "📅 Planned This Month"]
      :query [:find (pull ?b [*])
              :in $ ?start-day ?end-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/scheduled ?d]  ; The block ?b has attribute scheduled with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than the value ?start-day
              [(<= ?d ?end-day)]  ; The value ?d is less than the value ?end-day
              ]
      :inputs [:+7d :+30d]  ; Use the Logseq dynamic variable to start 7 days after today and go up to 30 days
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/scheduled])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the scheduled date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔜 Upcoming This Quarter"]
      :query [:find (pull ?b [*])
              :in $ ?start-day ?end-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/deadline ?d]  ; The block ?b has attribute deadline with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than the value ?start-day
              [(<= ?d ?end-day)]  ; The value ?d is less than the value ?end-day
              ]
      :inputs [:+30d :+90d]  ; Use the Logseq dynamic variable to start 30 days after today and go up to 90 days
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/deadline])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the deadline date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "📅 Planned This Quarter"]
      :query [:find (pull ?b [*])
              :in $ ?start-day ?end-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/scheduled ?d]  ; The block ?b has attribute scheduled with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than the value ?start-day
              [(<= ?d ?end-day)]  ; The value ?d is less than the value ?end-day
              ]
      :inputs [:+30d :+90d]  ; Use the Logseq dynamic variable to start 30 days after today and go up to 90 days
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/scheduled])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the scheduled date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔜 Upcoming This Year"]
      :query [:find (pull ?b [*])
              :in $ ?start-day ?end-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/deadline ?d]  ; The block ?b has attribute deadline with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than the value ?start-day
              [(<= ?d ?end-day)]  ; The value ?d is less than the value ?end-day
              ]
      :inputs [:+90d :+365d]  ; Use the Logseq dynamic variable to start 90 days after today and go up to 365 days
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/deadline])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the deadline date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "📅 Planned This Year"]
      :query [:find (pull ?b [*])
              :in $ ?start-day ?end-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/scheduled ?d]  ; The block ?b has attribute scheduled with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than the value ?start-day
              [(<= ?d ?end-day)]  ; The value ?d is less than the value ?end-day
              ]
      :inputs [:+90d :+365d]  ; Use the Logseq dynamic variable to start 90 days after today and go up to 365 days
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/scheduled])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the scheduled date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔜 Upcoming In The Far Future"]
      :query [:find (pull ?b [*])
              :in $ ?start-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/deadline ?d]  ; The block ?b has attribute deadline with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than the value ?start-day
              ]
      :inputs [:+365d]  ; Use the Logseq dynamic variable to start 365 days after today
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/deadline])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the deadline date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "📅 Planned In The Far Future"]
      :query [:find (pull ?b [*])
              :in $ ?start-day
              :where
              [?b :block/marker ?marker]
              [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
              [?b :block/scheduled ?d]  ; The block ?b has attribute scheduled with value ?d
              (not [?b :block/repeated? true]) ; The block ?b is not repeated
              [(> ?d ?start-day)]  ; The value ?d is greater than the value ?start-day
              ]
      :inputs [:+365d]  ; Use the Logseq dynamic variable to start 365 days after today
      :table-view? false
      :breadcrumb-show? false  ; Don't show the parent blocks in the result
      :result-transform (fn [result]
                          (sort-by
                          (fn [r]
                            [(get-in r [:block/scheduled])
                              (get-in r [:block/priority] "Z")]) result)) ; Sort the result by the scheduled date and then by priority
      }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🏃‍♂️ Next"]
  :query [:find (pull ?b [*])
    :where
      [?b :block/marker ?marker]  ; The block ?b has marker ?marker
      [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if ?marker is either "TODO" or "LATER"
      [?b :block/content ?content]  ; Get the content of the block ?b
      [(clojure.string/includes? ?content "#next")]  ; Check if ?content includes "#next"
      (not [?b :block/repeated? true]) ; The block ?b is not repeated
  ]
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
    (sort-by
      (fn [r]
        [
          (get-in r [:block/deadline] 99991231)
          (get-in r [:block/scheduled] 99991231)
          (get-in r [:block/priority] "Z")
        ]
      ) result)) ; Sort the result by the deadline date, then scheduled date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "💤 Waiting for"]
  :query [:find (pull ?b [*])
    :where
      [?b :block/marker "WAITING"]  ; The block ?b has attribute marker with value "WAITING"
      (not [?b :block/repeated? true]) ; The block ?b is not repeated
  ]
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
    (sort-by
      (fn [r]
        [
          (get-in r [:block/deadline] 99991231)
          (get-in r [:block/scheduled] 99991231)
          (get-in r [:block/priority] "Z")
        ]
      ) result)) ; Sort the result by the deadline date, then scheduled date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "👷 Delegated"]
  :query [:find (pull ?b [*])
    :where
      [?b :block/marker ?marker]  ; The block ?b has marker ?marker
      [(contains? #{"TODO" "LATER" "WAITING"} ?marker)]  ; Check if ?marker is either "TODO" or "LATER" or "WAITING"
      [?b :block/content ?content]  ; Get the content of the block ?b
      [(clojure.string/includes? ?content "#delegated")]  ; Check if ?content includes "#next"
      (not [?b :block/repeated? true]) ; The block ?b is not repeated
  ]
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
    (sort-by
      (fn [r]
        [
          (get-in r [:block/deadline] 99991231)
          (get-in r [:block/scheduled] 99991231)
          (get-in r [:block/priority] "Z")
        ]
      ) result)) ; Sort the result by the deadline date, then scheduled date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔄 Recurring Tasks"]
  :query [:find (pull ?b [*])
    :where
      [?b :block/marker ?marker]  ; The block has a marker
      [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
      [?b :block/repeated? true]  ; The block is marked as repeated
  ]
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
    (sort-by
      (fn [r]
        [
          (get-in r [:block/deadline] 99991231)
          (get-in r [:block/scheduled] 99991231)
          (get-in r [:block/priority] "Z")
        ]
      ) result)) ; Sort the result by the deadline date, then scheduled date and then by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔔 Unplanned By Priority"]
  :query [:find (pull ?b [*])
    :where
      [?b :block/marker ?marker]
      [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
      (not [?b :block/scheduled])  ; The block does not have a scheduled date
      (not [?b :block/deadline])  ; The block does not have a deadline
      (not [?b :block/repeated? true]) ; The block ?b is not repeated
      [?b :block/content ?content]  ; Get the content of the block
      (not [(clojure.string/includes? ?content "#next")])  ; The block does not contain the tag #next
  ]
  :table-view? false
  :breadcrumb-show? false  ; Don't show the parent blocks in the result
  :result-transform (fn [result]
    (sort-by
      (fn [r]
        (get-in r [:block/priority] "Z")
      ) result)) ; Sort by priority
  }
  #+END_QUERY
- #+BEGIN_QUERY
  {:title [:h3 "🔔 Unplanned"]
  :query [:find (pull ?b [*])
    :where
      [?b :block/marker ?marker]
      [(contains? #{"TODO" "LATER"} ?marker)]  ; Check if the marker is either "TODO" or "LATER"
      (not [?b :block/scheduled])  ; The block does not have a scheduled date
      (not [?b :block/deadline])  ; The block does not have a deadline
      (not [?b :block/repeated? true]) ; The block ?b is not repeated
      [?b :block/content ?content]  ; Get the content of the block
      (not [(clojure.string/includes? ?content "#next")])  ; The block does not contain the tag #next
  ]
  :table-view? false
  }
  #+END_QUERY

Thanks in advance !