Bug 8127 - Most-circulated items report doesn't work when limited by library
Summary: Most-circulated items report doesn't work when limited by library
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-18 17:48 UTC by Nicole C. Engard
Modified: 2023-01-25 22:56 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2012-05-18 17:48:37 UTC
I got this from a library:


I'm trying to get the "Most Circulated Items" report to give me something and I am not having success.  I chose a date range of 4 months, then I chose a library, then I chose a single item type (DVD1week) then I chose 20 for the limit, then I chose "library" for the "By" part of the limit and go an empty list.  So I went back and changed "library" to "Itemtype."  Now the system just hangs up spinning away without ever giving results.


I wrote this to help for now - but the canned report should work:

SELECT count(s.datetime) AS circs, b.title, b.author,
       i.ccode 
FROM statistics s
JOIN items i USING (itemnumber)
LEFT JOIN biblio b USING (biblionumber)
WHERE DATE(s.datetime) > DATE_SUB(CURRENT_DATE(),INTERVAL 4 MONTH) 
      AND DATE(s.datetime)<=CURRENT_DATE() AND 
      s.itemnumber IS NOT NULL AND i.itype=<<Item type|itemtypes>> AND
i.hombranch=<<Home branch|branches>>
GROUP BY b.biblionumber 
ORDER BY circs DESC 
LIMIT 20
Comment 1 Katrin Fischer 2023-01-25 22:56:03 UTC
I added a date range for the checkout dates and limit by item type: I get results.
Same date range, but with limit by library:

CGI::Compile::ROOT::kohadevbox_koha_reports_cat_issues_top_2epl::calculate(): DBI Exception: DBD::mysql::st execute failed: called with 1 bind variables when 0 are needed at /kohadevbox/koha/reports/cat_issues_top.pl line 59
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77