Query Help: Summarising paths

So basically your issue is just like this one Aggregating facet variables
See my last comment there.

Also see this example