Using filter for Query Report in ERPNext v13

Dear All,
Please help me how to use filter on a Custom Query report of version 13. This version does not create backend file for new report.

I’d like to filter opening_date by from_date and to_date

Thanks
Han

Hi @hanntd

Following links will help you understand the query better for V13

https://frappeframework.com/docs/user/en/guides/reports-and-printing/how-to-make-query-report

https://docs.erpnext.com/docs/v12/user/manual/en/customize-erpnext/articles/making-custom-reports

1 Like

Hi Nikunj_Patel,

I tried to test as you guided but I have an error message when show report:

Thanks,
Han

You have to define the filter in the filters section with the exact name that you use in the query
Mark the filter as mandatory. This is just to ensure the report doesn’t run with empty key value. Donot use the filter in the query until you make a refresh.
Refresh the browser once.
Run the report once.
you should now see the filter field.
Go back to the query and add the filter in the query. Whatever you have done in the query is correct.
save the query and run the report. Refresh the browser once. Just to ensure your changes are propagated.
Key in the filter value. You should now see the results.

There is a thread i have opened seeking answers to default the value for a filter. If you have already found the solution please respond.

Thanks @gsarunk so much, I have successful added filter as your guide.
Han

1 Like

I have found another way to define filters and default their values. Updated in the thread V13-How to default the filter value in Query reports.

This will also help you.