Home : GAVGZ
Q10662 - INFO: GAVGZ

GAVGZ returns the average of all of the values (values can contain data qualifiers) in the date range specified by the Offset and Grouping for the variable.

SYNTAX:

GAVGZ(VarNum, GroupOffset/StartDate, Grouping/EndDate, Decimal Places, MDL Rule, optional No Value Print) 

VarNum:  The variable number to get the average for.

GroupOffset/StartDate: Used with the Grouping parameter to set the dates to calculate the stat for.  Sets the number of Groups (set by the Grouping Parameter) to be added to set the dates.  See examples below. If this field is a date string (i.e. "07/16/2004") or refers to a cell with a date in it, it is assumed to be the start date to calculate the stat for.

Grouping/EndDate: Used to set which dates to calculate the stat for.  If the Grouping is a date literal string (i.e. "07/16/2004") or refers to a cell with a date in it, it is assumed to be the end date to calculate the stat for. Common Settings are:
"D" Days
“M” Monthly 
"R" Report Dates 
“Y” Yearly

Decimal Places: Sets the number of decimal places to be displayed. For variables with decimal places set to "Not Fixed" click here for additional formatting options.

MDL Rule: Sets when to display the MDL symbol (<,>, ND) with the calculated statistic.  Valid settings are:

1 Display MDL symbol if one of the values contains the MDL symbol
2 Display MDL symbol if all of the values contains the MDL symbol.
3 Display MDL symbol if over half the values contains the MDL symbol.
4 Cascade all symbols
5 If all values are '<', report as <, else use 0 for <.  (<2,<2 = <2, 10,<2 = 5, <2,<4=<3).  NOTE: For < entries, ignores the variables MDL Rule setting and uses entered value if all are <, otherwise uses zero (0).   
6 Ignore entries with symbols (data qualifiers). <2,>10,14=14.  2,10 = 6
7 If all values are '<', report as < the values in db, if some have qualifiers and some results don't use 1/2 entered value for <, db value for other values and drop symbol:  <2,<2= <2, <2, 5 = 3, ie (1+5)/2
9 Ignore non detected entries (i.e. < and ND).  <2, ND, >20, 10 = >15

NOTE:  For rules 1-5, if ALL values are ND, the average is reported as ND. 

No Value Print: Sets a string to be displayed if there are no values in the date range.

NOTES:

In Design, Spread Reports use Locate, Group Summary to place this formula on a report.

EXAMPLES:

GAVGZ(1,3,"Q",2,1) returns the average of the values for variable 1, of the second quarter of the report displaying 2 decimals and a MDL symbol if at least one value in the quarter contains a symbol.

GAVGZ(1,3,"Q",2,1,"X") returns the average of the values for variable 1, of the second quarter in the group displaying 2 decimals and a MDL symbol if at least one value in the quarter contains a symbol.  Returns "X" if no values are found.

Download Example Template: Help_GAVG_Examples.ss3 (Click here for download instructions)

See Also: Spread Functions, Group Summary 

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
can you show an example on how ND symbols are handled when GAVGZ uses them ? Approved: 5/5/2009 2:32 PM
Created on 1/25/2008 10:00 AM.
Last Modified on 4/18/2024 5:22 PM.
Last Modified by Scott Dorner.
Article has been viewed 6064 times.
Rated 7 out of 10 based on 5 votes.
Print Article
Email Article