avg() or average()
Returns the average of the values of a measure field.
Example - Calculate the Average Amount of an Opportunity Grouped by Type
Use avg() to compare the average size of
opportunities for each account
type.
1q = load "DTC_Opportunity";
2q = group q by 'Account_Type';
3q = foreach q generate 'Account_Type' as 'Account_Type', avg('Amount') as 'avg_Amount';