Query that shows me pages tags with .. this week

Hey,
can anyone do me a query that shows me all blocks that are tagged with #sehr_gut,#gut,#mittel,#schlecht,#sehr_schlecht this week ?
The Query should only show the blocks tagged with these tags in the last 7 day.
It would be so kind, if anybody could make this query for me.
white

At your service :saluting_face:

#+BEGIN_QUERY
	  {:title "Emotion tags"
	   :query [:find (pull ?b [*])
	         :where
	         [?p :block/name ?name]
	         [(contains? #{"sehr_gut" "gut" "mittel" "schlecht" "sehr_schlecht"} ?name)]
             [?b :block/refs ?p]
	       ]
	   :table-view? false
	   :collapsed? false
	  }
	  #+END_QUERY

image

Thanks. My solidair. xD
I have to learn advanced Querys. You’re helping me to much. xD
Have a nice day

1 Like

I’ve tried this, it works, but can you do it that it shows only pages created in the last 7 day. Like all pages tagged with… and created in the last 7 days

Definitely! And don’t worry, I love helping :slight_smile:

#+BEGIN_QUERY
	  {:title "Emotion tags"
	   :query [:find (pull ?b [*])
             :in $ ?day
	         :where
	         [?p :block/name ?name]
	         [(contains? #{"sehr_gut" "gut" "mittel" "schlecht" "sehr_schlecht"} ?name)]
             [?b :block/refs ?p]
             [?b :block/page ?j]
             [?j :block/journal-day ?d]
             [(>= ?d ?day)]
	       ]
       :inputs [:7d]
	   :table-view? false
	   :collapsed? false
	  }
	  #+END_QUERY