Studio Pro 8 has reached its end of support. To upgrade to a supported version, see Moving from Mendix Studio Pro 8 to 9.

Studio Pro 8 has reached its end of support. To upgrade to a supported version, see Moving from Mendix Studio Pro 8 to 9.

XPath Avg

Last modified: August 20, 2024

Overview

The avg() function returns the average of its argument.

The function requires an XPath query as argument.

The function must specify a column in the query to aggregate.

The query must specify an attribute that has a numeric type.

Examples

This query returns the average total price of all placed orders:

avg(//Sales.Order/TotalPrice)

This query returns the average total price of all orders placed by a customer named "Jansen":

avg(//Sales.Order[Sales.Customer_Order/Sales.Customer = 'Jansen']/TotalPrice)