Home : MAVG
Q10821 - INFO: MAVG

MAVG returns the monthly average of the specified variable, which is stored on the last day of each month.  The variable being averaged must be spedified as a Conditional Variable use "C" instead of "V"). 

SYNTAX:

MAVG(Cx, optional Time Increment)
where :
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:

The variable to be averaged must be specified as a Conditional Variable (use "C" instead of "V")

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 Monthly average from a variable

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

V104 = MAVG(C70)

Variable 104 will contain the monthly average of variable 70, on the last day of the month:

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


Source variable (70) is set to Hourly and Target variable (104) is set to Daily.

V70 - Is a hourly parameter
V104 - Is a daily calculation

V104 = MAVG(V70,BYHOUR)

Note: You MUST specify the Time Increment (BYHOUR) that matches the source variables frequency (IE the source variable V70 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...
No user comments available for this article.
Created on 2/29/2008 2:22 PM.
Last Modified on 2/9/2015 1:41 PM.
Last Modified by No Author Name Available!.
Article has been viewed 5109 times.
Rated 6 out of 10 based on 4 votes.
Print Article
Email Article