[rt-users] Statistics: 0.1.1

Todd Chapman todd at chaka.net
Thu Mar 31 06:36:44 EST 2005


On Thu, Mar 31, 2005 at 03:09:33PM +1200, Gerwin van de Steeg wrote:
> Query,
> 
> I've got a report for statistics which generates a yearly report of
> tickets, ordered by month and status.
> 
> Can i specify multiple LimitTransactionDate entries on a query.
> 
> ie.
> 
> my $tix = new RT::Tickers($session('CurrentUser'));
> $tix->LimitQueue (VALUE => $queue);
> $tix->LimitTransactionDate (OPERATOR => '>', VALUE => '20040101000000');
> $tix->LimitTransactionDate (OPERATOR => '<', VALUE => '20050101000000');
> $tix->UnLimit;
> if ($tix->Count) {
>   while (my $t = $tix->RT::SearchBuilder::Next) {
>     $counts[(localtime($t->ResolvedObj->Unix))[4]](resolved)++
>       if $t->Status eq "resolved";
>     $counts[(localtime($t->LastUpdatedObj->Unix))[4]](deleted)++
>       if $t->Status eq "deleted";
>     $counts[(localtime($t->CreatedObj->Unix))[4]](created)++
>  )
> )
> 
> 
> This seems to work, however if I do this for 2005-2006 then I'm getting
> incorrect values, in months which have not yet passed.
> 
> or is there a more accurate, elegant way of doing this.
> 

Why are you call Limit and then calling UnLimit?

-Todd



More information about the rt-users mailing list