AVGDIFF
Returns a number that represents the average difference between each of a child records of the parent.
AVGDIFF ( <field_name> [, <field_order>] [, <filter_query>] )
-
field_name: The numeric field to base the calculation on.
-
field_order: The field to use for the sorting the child records.
-
filter_query: A query string representing the domain of records to include.
Example: Create field on the CUSTOMER table that returns, for each customer, the average difference in days between product purchases where the product code is B.
AVGDIFF( [PRODUCT.PRODUCT_PURCHASE_DATE] ,[PRODUCT.PRODUCT_PURCHASE_DATE], [PRODUCT.PRODUCT_CODE] = "B")