OK, so… for our records, you are combining the filter requirements above with the custom analytics period from your earlier post, Calculate the number of events between two dates
Your goal is in fact to count the number of patients, marked as Final Positive Cases and Female, (both data elements in separate nonrepeatable program stages), and you would like the period to be the date of ART start date.
This behaviour appears to be a bug. It looks like you are using 40.0 or 40.1 as you have the Organization Unit field, which version are you using? I was not able to replicate this on 40.0
One thing that might cause the error is if the CONFIRMATORY\.DATE_CONFIRM
is of type DATETIME. Is it just a date?
As a workaround, you might instead make your boundary
Enrollment date : before end of period
and your filter
CONFIRMATORY\.Final Interpretation == "1_Positive" && SCREENING\.Sex at birth == "FEMALE" && d2:daysBetween(V{analytics_period_start}, #{ART_start_date})>=0 && d2:daysBetween(#{ART_start_date}, V{analytics_period_end})>=0
Relatedly, I see that you have a period boundary offset this would evaluate data from the previous quarter of your Data Visualizer query – if you request data for Q2 2023, it would return ART start dates in Q1, etc