regarding aggregated quarry builder

Hi Dear all

I am from Sri Lanka . I am try to build patient taking system for leprosy patient by using DHIS tracker model. But i am facing problem with writing quarries to aggregate patient data. Can anybody give guidance to create quarries.

thank you


Gayan Yasantha Piyasena