in reply to Calculating the average of a column in a flat-file database
my ( $total , $number ); if ($domain eq "ATM") { if ($temp1[36] eq "In Production") { $total += $temp1[38]; $number++; } } } my $average = ( $number ) ? $total/$number : 0 ; #catch in case of no +data
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Calculating the average of a column in a flat-file database
by suggus (Sexton) on Oct 26, 2001 at 02:47 UTC | |
by Hofmator (Curate) on Oct 26, 2001 at 13:03 UTC |