Advance Query - aggregate based on property value

Hi experts!

Need some help with the advanced query: I’m trying to get daily positive scores based on certain block inputs, best to have a weekly view, i.e w45, date 11/06, total score.
The basic output should be date, total positive score, and input is based on certain block with the property type “type” is within (" “win” “mistake” “thoughts” “learning”,“emotion”), and each block should have an associated “positive” property.

{:title [:h2 "test"]
 :query [:find ?d (sum ?post)
       :in $ ?start ?end
  [?page :page/properties ?props]  
  [?b :block/properties ?props]
  [(get ?props :positive) ?post] 
  [( not (missing?  ?post))]
  [?page :page/properties ?props]  
  [(get ?props :date) ?d] 
   [(> ?d ?start)]
   [(< ?d ?end)]
   ( [(get ?props :type) ?t]
      [(contains? #{ "win" "mistake" "thoughts" "learning","emotion"} ?t)])

     :input [:7d-before :today]

The above query did not return anything… Thanks in advance!