Basically, I've been handed a report that is:
[tt]
0-6 days 7-30 days 30+ days
DDD BBB DDD BBB DDD BBB
Type 1 5 2 2 4 6 8
Type 2 2 6 2 5 7 9
[/tt]
Where the help desk tickets that belong to the DDD department are shown separate from those belonging to the BBB department. Now management wants another report that
displays the persons to which these aging tickets belong. Something like:
[tt]
0-6 days 7-30 days 30+ days
DDD BBB DDD BBB DDD BBB
John 3 0 1 0 4 0
Tim 0 1 0 1 0 4
Bruce 0 1 0 3 0 4
Type 1 5 2 2 4 6 8
John 1 0 1 0 4 0
Will 1 0 1 0 3 0
Bruce 0 4 0 3 0 4
Mike 0 2 0 2 0 5
Type 2 2 6 2 5 7 9
[/tt]
The report I was given sorts by ticket type. Then, as it's running the report, it has a print-time formula that looks at which department owns the ticket, figures out how old it is and puts the totals in the correct column based on ownership by department and age. But now they also want to look at who owns each ticket.
Also, the report I was given has a hardcoded variable (@variablename -- is that the right term for those that use the @) that reads each total that is computed in the print-time formula so it can be put on the report. For instance, they have @DDD6 and @BBB6 which represent the 6 day old tickets for the DDD department and the BBB departement respectively. They also have @DDD30 and @BBB30 and @DDD31 and @BBB31 (actually, they have a lot more -- the actual report has more columns becuase they break the aging up into more categories, but you get the general idea).
So... if I continue the logic that was previously used in the report I'll need @John6, @John30, @John31 and @Tim6, @Tim30, @Tim31 and so on and so on. First, the number of variables to keep track of would get crazy. Also, a change in employees (leaving or new hire) would require changing of the code.
So.. I thought instead of using the previous logic I would us an array that would basically read the name of the owner of the ticket, check the array to see if we'd already started subtotals for that owner, add another element if needed, do the subtotalling and then report the results. I'm not sure how I'm going to do it and thus was asking about arrays. But if that's not the best way to go, I'm very open to suggestions
Thanks all.
-= Hypermommy =-