VIOL returns the number of violations or exceedances for a variable.
SYNTAX:
VIOL(VarNum, Grouping, Statistic, Limit,optional GroupOffset/StartDate, Grouping/EndDate)
VarNum: The variable number to count violations for.
GROUPING: Used to set the dates to calculate the statistic to compare to the Limit. Valid Settings are:
Grouping 
Description 
"D" 
Days. For Daily variables, all values are compared to the limit, for Daily Detail variables the Statistic is calculated for the day and compared to the limit) 
"V" 
Compare all values to the limit (the statistic is ignored). Typically used with daily detail variables where you want to count every time the value is in violation. For example, with a grouping of "V" with an hourly variable you could have up to 24 violations in a day. 
"M" 
Monthly 
"Q" 
Quarterly 
"SA" 
SemiAnnual 
"S" 
Seasons  Winter, Spring, Summer, Fall. 
"W1"  "W20" 
Week (where 120 defines the week) (Click here for definition of "Week")

"RMAxx" 
Rolling Annual Average, calculates the xx number of monthly averages and then calculates the "Statistic" of those values. IE If the report dates are Dec 1, 2007 thru Dec 31st, 2007 a grouping of "RMA12" would calc the Monthly Average for Jan 2007, Feb 2007... Dec 2007 and then calc the stat of those Monthly Averages.

"MAxx" 
Last xx number of months. IE If the report dates are Dec 1, 2007 thru Dec 31st, 2007 a grouping of "MA12" would calc the stat for Jan 1, 2007 thru Dec 31st, 2007. 
"L" 
Date range of Limit. 
Statistic: The statistic to calculate:
Stat 
Description 
Avg 
Average 
GMean 
Geometric Mean (Zeros (0) are ignored) 
GMean1 
Geometric Mean (Convert 0 to 1) 
GMean2 
Geometric Mean (Add one to all) 
Total 
The total or sum 
Median 
The Median value 
AVG_MED 
The "Average Median" 
"" or None 
No Stat, compare all values to limit 
Limit: The Limit Name to compare the statistic to. Limits are entered for each variable using Variable Edit  Limits Tab. The common settings are:
Name 
Description 
DMAX 
Daily Max Limit 
DMIN 
Daily Min Limit 
WMax 
Weekly Max Limit 
MMAX 
Monthly Max Limit 
MMIN 
Monthly Min Limit 
>x 
Compare stat to constant x, ie >30 
<x 
Compare stat to contant x 
ENTRYMAX 
Compare Value to variable's Entry Max 
ENTRYMIN 
Compare Value to variable's Entry Min 
GroupOffset/StartDate: OPTIONAL. 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: OPTIONAL. 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 Click here for available Grouping options
NOTES:
For industrial pretreatment, you can use a TRC qualifier in parenthesis to count the number of TRC violations. Valid Settings are:
TRC_I For type 1 TRC limits. Multiplies the limit by 1.4 before comparing the value to it. Example DMAX(TRC_I).
TRC_II For type 2 TRC limits. Multiplies the limit by 1.2 before comparing the value to it. Example DMAX(TRC_II).
This function is used to locate the count of violations into a report. There are many varieties of violations available including: Daily, Weekly, Monthly, Quarterly, and Yearly. Violations can be based on several different methods of calculation including: Average, Total, and several variations of Geometric mean. There are also several ways to determine if data is a violation, options to determine which violations to display,(Daily Maximum, Daily Minimum, both Max and Min, Weekly Maximum, Weekly Minimum, and so on). Also, notice below there are several different possibilities for Weekly as there are several different definition for "week".
The following names can be used to look at both a max and min limits: DBOTH (compare to both the DMIN, DMAX limit), MBOTH (compare to both the MMIN and MAX limit)...
EXAMPLES:
Viol(4011,"M","Avg","MMax")
For variable 4011, calculate the Monthly (grouping "M") Average and compare the value to the Monthly Max Limit. If the report dates are set to one month (i.e. 1/1/2004 through 1/31/2004) this function will calculate the monthly average for Janurary and compare the value to the January limit for variable 4011. If the report dates are set to 12 months (i.e. 1/1/2004 through 12/31/2004) this function will calculate the monthly average for each month of the year and compare each value to the corresponding limit for variable 4011.
Viol(4081,"D","Avg","DBOTH")
For variable 4081 (a daily parameter) compare every value entered for the report dates to both the Daily Min and Daily Max limit. For daily variables with a grouping of "D" the Stat is ignored.
Viol(5001,"D","GMEAN1","DBOTH")
For variable 5001 (an hourly parameter) calculate the daily Geometric Mean (where 0 and negative values are converted to a 1, i.e. GMEAN1) for each day of the report and compare the calculated value to the Daily Max Limit.
Viol(4013,"D","Avg","WMAX")
For variable 4013 compare every value for the report dates to the Weekly Max limit. This is typically used when variable 4013 is a calculated Weekly Average (ie uses the WAVG math toolbox function).
Viol(4011,"D"," ","DMAX")
For variable 4011 compare every value, no stat, for the report dates to the Daily Max limit.
Viol(4011,"D"," ","DMAX",2,"M")
For variable 4011 compare every value, no stat, for next month (i.e. offset of 2 and grouping of "M") to the Daily Max limit.
Viol(81,"V"," ","ENTRYMIN") + Viol(81,"V"," ","ENTRYMAX")
For variable 81 compare every value, no stat, for the report dates to the Variables Entry Min and Entry Max.
Viol(4011,"M","AVG",">300")
For variable 4011 compare every value to determine if the average is greater than 300.
Viol(4011,"M","AVG ","<300")
For variable 4011 compare every value to determine if the average is less than 300.
VIOL(4011,”D”,”None”,”DMAX(TRC_I)”)
Compares all values in the report date range for variable 4011 to the Daily Max limit * 1.4. IE if the limit is 30, this will count the number of values > 42 (30 * 1.4)
VIOL(1,"RMA12","AVG","AMAX")
Calculates the Monthly Average for the current month and the previous 11 months and then calculate the Average of those values and compare the value to AMAX limit.




No Related Articles Available.




No Attachments Available.




No Related Links Available.







No user comments available for this article.






Created on 2/3/2008 7:23 AM. 

Last Modified on 4/24/2014 10:53 AM. 

Last Modified by Scott Dorner. 

Article has been viewed 3767 times. 

Rated 6 out of 10 based on 4 votes. 

Print Article 

Email Article


