It’s better to use SQL cohorts than indicators to do that. So your sample SQL cohort will be like this:
select encounter_id from encounter where date_created >= :startDate AND date_created <= :endDate and location_id = :location
Take note of not using count(*)
. Openmrs automatically returns to you the number of records that match that query so the count(*)
is not much needed.