Monday Minutes : Editing a SQL report
Editing an Existing Report
Whether a report has been found in the Koha Report Wiki or already exists in your report library- sometimes it would be helpful if the report could be edited to allow the user to choose which value is used vs just having one value.
In the tutorial video, Jessie and Kelly chose a report that was written specifically looking at one Shelving Location. The WHERE statement of this report looked like this:
AUDIO is the Authorized Value code found in the Category "loc". But what if the library would like to use this report to look at different shelving locations and not just specifically AUDIO?
The WHERE statement could be altered to allow for the user to choose which location at the time of running the report. If so, then the WHERE statement of the report would look like this:
WHERE i.location=<<Shelving Location|loc>>
Below is an example of the report we showed during the video:
This same principle could be used for Item Types, Collection Codes, Not for Loan statuses and even branches. If there are other values to pull from, then this statement can be altered in your SQL report to allow the user to change.
For Item Type:
WHERE itype=<<Item Type|itemtypes>>
For Collection Codes:
Not for Loan Statuses:
WHERE notforloan=<<Not for Loan|not_loan>>
More Report Resources
If you are new to using the Reports Module, here are some great ByWater Tutorials to visit:
The Reports portion of the Koha Manual is also very helpful.
Want More Monday Minute Tutorials?
Read more by Kelly McElligott