Home : WAVGn
Q10747 - INFO: WAVGn

WAVGn returns a weekly average of a specified variable.  The week is defined by a number (n), which specifies the begining day of the week (for n=7, the week is Sunday through Saturday).  The value calculated is placed on the last day of the defined week.  Click here for a table demonstrating the different week definitions available.

SYNTAX:

WAVGn(Cx, optional Time Increment)
where :
n is a number that defines the week
Cx is a conditional variable x
Time Increment Optional - specifies the source variables (Cx) Frequency when the Source Variable (CX) and target variable's (i.e. the variable being calculated) frequencies do not match.

NOTES:

n can only be 1 through 20, all other numbers will come up as an invalid equation in variable setup.

The result is stored based on target variables frequency:

  • Daily - Last day of the month.
  • Daily Detail - First slot on the last day of the month.

EXAMPLE 1: Return the Weekly average from a variable

Source variable (70) is set to Daily and Target variable (93) is also set to Daily. Because both the Source and Target variables are the same (Daily), the time increment BYDAY will be used.

V93 = WAVG3(C70)

Defines variable 93 as a single value equal to the weekly average of variable 70 with the week defined as Wednesday through the following Tuesday.  The average value is listed on the last day of each week, in this case: Tuesday.

EXAMPLE 2: Return the Weekly average from an Hourly variable into a Daily Calculation.


Source variable (4714) is set to Hourly and Target variable (4715) is set to Daily.

V4714 - Is an hourly parameter
V4715 - Is a daily calculation

V4715 = WAVG3(V4714,BYHOUR)

 

Note: You MUST specify the Time Increment (BYHOUR) that matches the source variables frequency (IE the source variable V4714 is Hourly, therefore we specify BYHOUR) in order for the function to return the correct value.

See: Working with Daily Detail Variables in Calculations.

 

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...
Explained clearly and with good examples. Approved: 5/13/2010 3:23 PM
Created on 2/12/2008 4:09 PM.
Last Modified on 2/11/2015 11:09 AM.
Last Modified by No Author Name Available!.
Article has been viewed 8872 times.
Rated 6 out of 10 based on 8 votes.
Print Article
Email Article