MINDIFF
For each parent, returns a number that represents the minimum difference between each of the child records.
MINDIFF ( <field_name> [, <field_order>] [, <filter_query>] )
-
field_name: The numeric field to base the calculation on.
-
field_order: The field to use for sorting the child records.
-
filter_query: A query string representing the domain of records to include.
Example: Create a field on the CUSTOMER table to return the smallest difference in value between each customers purchases, sorting child records by the product purchase date and only look at records where product code is B.
MINDIFF( [PRODUCT.PRODUCT_PURCHASE_DATE] ,[PRODUCT.PRODUCT_PURCHASE_DATE], [PRODUCT.PRODUCT_CODE] = "B")