def _cases_total_query(self, values, filters, lower, upper):
        return CaseData.objects \
            .values(*values) \
            .filter(filters) \
            .filter(
                case_owner__in=self.owners_needing_data,
                domain=self.domain,
                opened_on__lt=upper) \
            .filter(Q(closed=False) | Q(closed_on__gte=lower)) \
            .annotate(count=Count('case_id'))
Default Dataset constructor
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/callcenter/indicator_sets.py/CallCenterIndicators._cases_total_query--crossover with--dataset/ETHPy150Open apache/climate/ocw/dataset.py/Dataset.__init__