man Lire::Sum () - Lire::Sum

NAME

Lire::Sum

SYNOPSIS

FIXME

DESCRIPTION

Class that implements the sum operator. This operator will compute the field's sum in a group of DLF records.

It's possible to compute a weighted sum in which each value is first multiplied by the value of another DLF field.

Its also possible to express the count as a ratio of the total count for the group or table.

METHODS

Creates a new Lire::Count object. In addition to the values supported by its parents, the weight and ratio attributes will be initialized to the values specified in the CW%params argument.

weight( [$new_weight] )

Returns the DLF field's name by which the values will be multiplied before being summed.

You can change the weight field by specifying a new name as the CW$new_weight parameter. Use undef to remove the use of a weighting field.

ratio([$new_ratio])

Returns how the sum will be expressed. This can one of three possible values:

none
Default. The absolute sum will be used.
group
The sum will be expressed as a percentage of the group's sum.
table
The sum will be expressed as a percentage of the table's total sum.

SEE ALSO

AUTHOR

  Francis J. Lacoste <flacoste@logreport.org>

VERSION

$Id: Sum.pm,v 1.15 2004/07/01 15:33:20 flacoste Exp $

COPYRIGHT

Copyright (C) 2001, 2002 Stichting LogReport Foundation LogReport@LogReport.org

This file is part of Lire.

Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.