If you would like to upgrade to a newer long-term support version of Studio Pro, see Moving from Mendix Studio Pro 8 to 9.

XPath Sum

Last modified: August 20, 2024

Overview

The sum() function returns the sum 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 sum of the total prices of all placed orders:

sum(//Sales.Order/TotalPrice)

This query returns the sum of the total prices of all the orders placed by a customer named “Jansen”:

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