eg.
1|May_2006|Apples|2
2|May_2006|Apples|3
3|Jun_2006|Oranges|2
4|Jun_2006|Oranges|3
5|Jul_2006|Pears|2
6|Jul_2006|Pears|3
.
.
etc
I'm trying to display so the results looks like
product May_2006 Jun_2006 Jul_2006...dec_2006
Apples 5 5 5
Oranges 5 5 5
Pears 5 5 5
and so on for each product and month/year
Here is the code I have been trying to get to work.
open (DB, "<$db_file_name") or &cgierr("error in count. unable to open database: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB,1); }
@lines = <DB>;
close DB;
foreach $line (@lines) {
chomp ($line);
@data = &split_decode($line);
++$count{$data[27]}; # months
$month{$data[5]} += $data[9];
$actual{$data[5]} += $data[9];
++$count;
}
for ($i = 1; $i<=52; ++$i) {
print qq|$i : $month{$data[27]} : $month{$i} : $actual{$i}<BR>|; }
Any help or advise in the right direction would be great appreciated as I have tryed every combination.

