OFMVSTAT returns the specified summary statistic for a list of variables from a different facility. Variables can be of different types (IE Calculated, Daily, Hourly, etc...).
SYNTAX:
OFMVSTAT("Facility","Stat",Offset,Grouping, VarId1, VarId2,…VarId99)
or
OFMVSTAT("Facility","Stat",Offset,Grouping, "Where Clause")
Facility: Facility to query against, specified by its unique identifier in quotes (e.g. "OPSWWTUTOR")
Stat: The statistic in quotes (e.g. "AVG") of the value to calculate.
Stat |
Notes |
Avg |
Average of values |
Sum |
Total of values |
Max |
Maximum value |
Max_VarNum |
Returns the Variable Number of the variable that has the maximum value. |
Min |
Minimum value |
Min_VarNum |
Returns the Variable Number of the variable that has the minimum value. |
First |
First value found by date |
First_VarNum |
The variable number of the variable that is the first value found. |
Last |
Last value found by date |
Last_VarNum |
The variable number of the variable that is the last value found. |
GMean1 |
Returns the Geometric Mean of the values (convert 0 (zeros) to 1) |
GMean2 |
Returns the Geometric Mean of the values (Add one to all if zero found) |
GMean3 |
Returns the Geometric Mean of the values (Ignore zeros) |
NOS,Count |
Retruns the count or number of values found |
PERCxx |
Returns the value at the xx Percentile (i.e. PERC90). |
PERAxx |
Returns the value at the xx Percentile (averages two closest values if exact match not found) |
PERIxx |
Returns the value at the xx Percentile (interpolates two closest values if exact match not found). NOTE: This is the technique the Excel Percentile function uses. |
PERExx |
Returns the value at the xx Percentile (interpolates two closest values, excludes first and last value). NOTE: This is the technique the Excel PERCENTILE.EXC function uses. |
GTx |
Returns the number of values greater than x (i.e. GT30). |
LTx |
Returns the number of values less than x. |
EQx |
Returns the number of values equal to x |
NEx |
Returns the number of values not equal to x. |
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 Groupings are:
"D" Days
“M” Monthly
"R" Report Dates
Click here for availiable Grouping options
VarId1..VarId99: A comma separated list of variables that sets which variables to calculate from. NOTE: This function uses VARIDs, not Varnums.
Where clause Instead of providing a list of variables, you can use an SQL Where clause against the VarDesc table to get the list of variables. I.E. “Units = 'mg/L'” wound return all variables with Units set to mg/L. See Examples.
NOTES:
To Locate this formula when designing a report, use Locate, Other Facility Group Summary or Locate, Other Facility Combined Group Summary.
SEE ALSO:
MVSTAT, MVSTATDATE, MVSTATZ, OFMVSTATZ, OFMVSTATDATE
EXAMPLES:
OFMVSTAT("OPSWWTUTOR", "AVG",1,"M",36) Returns the average for the current month for variable id 36 (Varnum 4001-Effluent Flow) from the OPSWWTUTOR facility.
OFMVSTAT("OPSWWTUTOR", "MIN",1,"M",37,40) Returns the single, minimum value for the current month for varids 37 and 40 (Varnums 4011 and 4041) from the OPSWWTUTOR facility.
OFMVSTAT("OPSDWTUTOR","MAX",1,"M","UNITS = 'mg/L'") Returns the single, maximum value for the current month for all variables that have mg/L as units from the OPSDWTUTOR facility.