bug 3097: statistics on itemcount not working
replacing issues.itemnumber by statistics.itemnumber since issues was not included in the query. All statistics on circulation for item count were zeroed. [RM note: specifically, this patch fixes the results when you set the 'cell value' to 'count unique items'] Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
parent
c90dd8b512
commit
89b537273d
1 changed files with 2 additions and 2 deletions
|
@ -426,12 +426,12 @@ sub calculate {
|
|||
my $strcalc = "SELECT $linefield, $colfield, ";
|
||||
$strcalc .= ($process == 1) ? " COUNT(*) " :
|
||||
($process == 2) ? "(COUNT(DISTINCT borrowers.borrowernumber))" :
|
||||
($process == 3) ? "(COUNT(DISTINCT issues.itemnumber))" : '';
|
||||
($process == 3) ? "(COUNT(DISTINCT statistics.itemnumber))" : '';
|
||||
if ($process == 4) {
|
||||
my $rqbookcount = $dbh->prepare("SELECT count(*) FROM items");
|
||||
$rqbookcount->execute;
|
||||
my ($bookcount) = $rqbookcount->fetchrow;
|
||||
$strcalc .= "100*(COUNT(DISTINCT issues.itemnumber))/ $bookcount " ;
|
||||
$strcalc .= "100*(COUNT(DISTINCT statistics.itemnumber))/ $bookcount " ;
|
||||
}
|
||||
$strcalc .= "
|
||||
FROM statistics
|
||||
|
|
Loading…
Reference in a new issue