Academic Year Filter in Standard Report

We have created a standard report to monitor chronic student absence. It’s a HTML report that utilizes DHIS2 API to retrieve attendance data, aggregates attendance for each student (Present, Absent) then calculates average absence for each student. Problem is standard report doesn’t provide a way to filter the period by academic year and the financial years provided don’t match up with the Academic Cycle. Does anyone know a way of having Academic Year perhaps in the HTML?

2 Likes

Hey

I’m guessing you are using JavaScript after retrieving the values? If so you could retrieve the entire period and then use JavaScript to filter the period?

Hey, what is the relationship the standard report of DHIS2 and the HTML report you created using the DHIS2 API?

Hi Sharaf, that means retrieve without including the period filter… how will that impact the performance of the report?

1 Like

Hi @mutesasira Yes DHIS2 API and Javascript to query data. Javascript to carry out calculations and HTML to format the output

1 Like

Having an Academic Year Picker in the standard report with the value defining start and end date for the AY, then sending those variables during the API call like shown in the below snippet worked
events/query/wQaiD2V27Dp.json?startDate=${startDate}&endDate=${endDate}

1 Like

@cgitosh We addressed the issue by updating the API query to replace the period dimension with specific startDate and endDate parameters corresponding to the academic year. Additionally, we added a dropdown in the HTML report, allowing users to select between predefined academic years. Based on the selection, the report dynamically makes requests to the DHIS2 API using the appropriate date range.

Example query structure:

https://dhis2Instance/api/analytics/events/query/programID.json
?startDate=2024-09-01
&endDate=2025-06-30
&dimension=otherDimensionsHere
&paging=false
&outputIdScheme=NAME

This approach ensures that the report aligns with the academic year rather than the financial year, providing the required flexibility for monitoring chronic student absence.

2 Likes

@Fernando_Inacio thank you very much again for your support. It’s working as expected

1 Like