Statistics: 0.1.1

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]++
if $t->Status eq “resolved”;
$counts(localtime($t->LastUpdatedObj->Unix))[4]++
if $t->Status eq “deleted”;
$counts(localtime($t->CreatedObj->Unix))[4]++
)
)

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.

Gerwin van de Steeg

signature.asc (189 Bytes)

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]++
if $t->Status eq “resolved”;
$counts(localtime($t->LastUpdatedObj->Unix))[4]++
if $t->Status eq “deleted”;
$counts(localtime($t->CreatedObj->Unix))[4]++
)
)

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

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]++
if $t->Status eq “resolved”;
$counts(localtime($t->LastUpdatedObj->Unix))[4]++
if $t->Status eq “deleted”;
$counts(localtime($t->CreatedObj->Unix))[4]++
)
)

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

From what I can gather, there seems to be no difference in the report
generated (I’ve tried with and without the UnLimit).

-Gerwin

signature.asc (189 Bytes)

Query,

I’ve got a report for statistics which generates a yearly report of
tickets, ordered by month and status.

ie. (updated with 2005-2006 data)

my $tix = new RT::Tickers($session(‘CurrentUser’));
$tix->LimitQueue (VALUE => $queue);
$tix->LimitTransactionDate (OPERATOR => ‘>’, VALUE => ‘20050101000000’);
$tix->LimitTransactionDate (OPERATOR => ‘<’, VALUE => ‘20060101000000’);
$tix->UnLimit;
if ($tix->Count) {
while (my $t = $tix->RT::SearchBuilder::Next) {
$counts(localtime($t->ResolvedObj->Unix))[4]++
if $t->Status eq “resolved”;
$counts(localtime($t->LastUpdatedObj->Unix))[4]++
if $t->Status eq “deleted”;
$counts(localtime($t->CreatedObj->Unix))[4]++
)
)

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.

The graph basically contains the following values for 2005 (i’ve only
listed months that haven’t been yet)

Month Qty
May 2
Jun 1
Jul
Aug 1
Sep 1
Oct 7
Nov 5
Dec 11

-Gerwin

signature.asc (189 Bytes)