Wiki source code of Average
Version 1.4 by Abdelali EL MAJDOUBI on 2023/08/03 13:16
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | = Introduction = |
2 | |||
3 | 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. | ||
4 | |||
5 | == Syntax : == | ||
6 | |||
7 | * **${ixf:avg(xpathExp1, xpathExp2)}** calculates the average of the results obtained from evaluating "xpathExp1" and "xpathExp2". | ||
8 | * **${ixf:avg(xpathExp,"10")}** the result will be the average of the result obtained from evaluating "xpathExp" and 10. | ||
![]() |
1.3 | 9 | * **${ixf:avg("10","12","100")}** the result will be 40,66, which is the sum of 10 and 12 and 100 dividing by 3. |
![]() |
1.1 | 10 | |
11 | Ensure that numerical values are between double quotes : ${ixf:avg("10","12","100")}, | ||
12 | |||
13 | while xpath expressions should remain without any quote enclosures. | ||
14 | |||
15 | |||
16 | == Example : == | ||
17 | |||
18 | * **${ixf:avg(Documents/Order/DeliveryAddress/OrderLine/Price,"10"}** | ||
19 | |||
![]() |
1.2 | 20 | Let's suppose that the result of //Documents/Order/DeliveryAddress/OrderLine/Price// is 30, so the average is 20.00. |
![]() |
1.1 | 21 | |
22 | == Note: == | ||
23 | |||
![]() |
1.2 | 24 | * 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')}. |
25 | * The default display for the average includes **two** decimal places. |