Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Averaging several average columns

2 posts in PB Infomaker Report Writer Last posting was on 1998-10-21 19:11:26.0Z
Lori Posted on 1998-10-19 12:51:48.0Z
Newsgroups: sybase.public.infomaker.general
From: "Lori" <lori@asconline.com>
Subject: Averaging several average columns
Organization: ASC, Inc.
X-Newsreader: Microsoft Internet News 4.70.1155
Date: Mon, 19 Oct 1998 08:51:48 -0400
Lines: 15
Message-ID: <348_01bdfb68$382a2aa0$3500000a@lori95>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:6823
Article PK: 242852

We're working on a report that first averages from 2 to 5 different columns
on the report. (We do this at the group level.) We then need to take the
average of these columns. The problem occurs when only some of the columns
have values. For instance, if only 3 of the 5 columns have values, my
average is off because the calculation is using all 5 columns to calculate
the average. I need it to only use the 3 columns that have values when
calculating the average of the columns. How do I do this?

Thank you!
--
Lori L. Shaffer
Associated Software Consultants, Inc.


Terry Dykstra [TeamPS] Posted on 1998-10-21 19:11:26.0Z
Newsgroups: sybase.public.infomaker.general
From: "Terry Dykstra [TeamPS]" <no_spam_tdykstra@cfol.ab.ca>
Subject: Re: Averaging several average columns
Date: Wed, 21 Oct 1998 13:11:26 -0600
Lines: 23
Organization: Canadian Forest Oil Ltd.
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Message-ID: <348_SOb3RzR$9GA.148@forums.powersoft.com>
References: <348_01bdfb68$382a2aa0$3500000a@lori95>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:6814
Article PK: 242843

You could try using a computed field to count the rows to create your own
average:
sum (myfield for all) / sum ( if ( myfield <> 0, 1 , 0 ) for all )

--
Terry Dykstra [TeamPS]
Canadian Forest Oil Ltd.

Lori wrote in message <01bdfb68$382a2aa0$3500000a@lori95>...
>We're working on a report that first averages from 2 to 5 different columns
>on the report. (We do this at the group level.) We then need to take the
>average of these columns. The problem occurs when only some of the columns
>have values. For instance, if only 3 of the 5 columns have values, my
>average is off because the calculation is using all 5 columns to calculate
>the average. I need it to only use the 3 columns that have values when
>calculating the average of the columns. How do I do this?
>
>Thank you!
>--
>Lori L. Shaffer
>Associated Software Consultants, Inc.