This is an old revision of the document!
Monthly Circulation Statistical Reports
Monthly Circulation Stat Report by Statistical Category and Library
Submission Notes: This report was submitted on 5/19/10 by Amy Terlaga of Bibliomation, Inc. It was originally created by Dan Scott of Laurentian University. Version: Evergreen v.1.6.0.2 Data Sources Used: Running Tips/Guidelines: This report is designed to be run the day/month AFTER the month you are interested in getting monthly circulation totals. If you would like it to reflect this month's activity, remove - '1 month'::interval If you would like it to reflect activity from two months ago, change the 1 to a 2 (and so on). Where you see ORG, replace with your org unit's short name.
SELECT aou.name AS "Library", asceum.stat_cat_entry AS "Borrower Stat", count(acirc.id) AS "COUNT"
FROM action.circulation acirc JOIN actor.org_unit aou ON acirc.circ_lib = aou.id LEFT OUTER JOIN actor.stat_cat_entry_usr_map asceum ON asceum.target_usr = acirc.usr LEFT OUTER JOIN actor.stat_cat astat ON asceum.stat_cat = astat.id WHERE aou.shortname = **'ORG'**::text AND date_trunc('MONTH'::text, acirc.create_time) = date_trunc('MONTH'::text, now() - '1 mon'::interval) GROUP BY aou.name, asceum.stat_cat_entry
UNION
SELECT 'ZZZ Total' AS "Library", '' AS "Borrower Stat", count(acirc.id) AS "COUNT"
FROM action.circulation acirc JOIN actor.org_unit aou ON acirc.circ_lib = aou.id LEFT OUTER JOIN actor.stat_cat_entry_usr_map asceum ON asceum.target_usr = acirc.usr LEFT OUTER JOIN actor.stat_cat astat ON asceum.stat_cat = astat.id WHERE aou.shortname = **'ORG'**::text AND date_trunc('MONTH'::text, acirc.create_time) = date_trunc('MONTH'::text, now() - '1 mon'::interval)
ORDER BY 1, 2, 3;
Back to Evergreen Circulation Reports page