Average
Version 1.3 by Abdelali EL MAJDOUBI on 2023/08/03 13:16
Introduction
The average function calculates the middle number of a set of numbers by adding them all together and then dividing by how many numbers there are.
Syntax :
- ${ixf:avg(xpathExp1, xpathExp2)} calculates the average of the results obtained from evaluating "xpathExp1" and "xpathExp2".
- ${ixf:avg(xpathExp,"10")} the result will be the average of the result obtained from evaluating "xpathExp" and 10.
- ${ixf:avg("10","12","100")} the result will be 40,66, which is the sum of 10 and 12 and 100 dividing by 3.
Ensure that numerical values are between double quotes : ${ixf:avg("10","12","100")},
while xpath expressions should remain without any quote enclosures.
Example :
- ${ixf:avg(Documents/Order/DeliveryAddress/OrderLine/Price,"10"}
Let's suppose that the result of Documents/Order/DeliveryAddress/OrderLine/Price is 30, so the average is 20.00.
Note:
- Numerical values can be also enclosed within single quotes : ${ixf:avg('10','12','100')} OR mix single and double quotes, like this: ${ixf:avg("10",'12','100')}.
- The default display for the average includes two decimal places.