Conditional average in report footer??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report where I would like to Average values that meet a criteria. This report is actually running off a query to select people who have less than 7 weeks of data. The columns contain the person, number of weeks, weight loss. I would like to average the weight loss for only the people with total weeks = 6 in the report footer. This is what I tried and got nothing

IIF([CountofWeek number]=6,Avg[Weight loss]," "

HELP!!
 
Hi,

Use the DAvg function:

DAvg ("[Weight loss]", "[name of table/query]",
"[CountofWeek number]=6")

For details on the Domain Aggregrate Function DAvg search Microsoft help
for "DAvg"

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."



--------------------
| Thread-Topic: Conditional average in report footer??
| thread-index: AcPrbS4+2nTdGNiwQVqCBLzIaAvE+Q==
| X-Tomcat-NG: microsoft.public.access.reports
| From: "=?Utf-8?B?TGluZGE=?=" <[email protected]>
| Subject: Conditional average in report footer??
| Date: Wed, 4 Feb 2004 14:21:05 -0800
| Lines: 5
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.reports
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.access.reports:129807
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.access.reports
|
| I have a report where I would like to Average values that meet a
criteria. This report is actually running off a query to select people who
have less than 7 weeks of data. The columns contain the person, number of
weeks, weight loss. I would like to average the weight loss for only the
people with total weeks = 6 in the report footer. This is what I tried and
got nothing.

IIF([CountofWeek number]=6,Avg[Weight loss]," ")

HELP!!
|
 
Linda said:
I have a report where I would like to Average values that meet a criteria. This report is actually running off a query to select people who have less than 7 weeks of data. The columns contain the person, number of weeks, weight loss. I would like to average the weight loss for only the people with total weeks = 6 in the report footer. This is what I tried and got nothing.

IIF([CountofWeek number]=6,Avg[Weight loss]," ")


Close. Try this:

=Avg(IIf([CountofWeek number]=6, [Weight loss], Null))
 
Back
Top