If the source array is empty, this function returns an error.
Specifies the array to average.
1. |
In the following example, the function returns 7, the average of all elements of the source array. AVERAGE([5, 15,
1])
|
2. |
To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement. IF(COUNT([5, 15,
1]) > 0, AVERAGE([5, 15, 1]) , -1)
|
Specifies the array from which to obtain the elements to average.
Specifies the index of the first element of the subset in the source array.
Specifies the number of elements (beginning at StartIndex) to include in the subset of the source array.
1. |
The following example calculates the average of the subset of the source array specified by the index and count parameters, [5, 10, 6]. The function returns 7. AVERAGE([1, 2, 3,
5, 10, 6], 4, 3)
|
2. |
To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement. IF(COUNT([1, 2,
3, 5, 10, 6]) > 0, AVERAGE([1, 2, 3, 5, 10, 6], 4, 3) ,
-1)
|
Specifies the array to average.
Specifies the expression to apply to each element of the source array.
1. |
The following example performs the expression Item/10, which results in array [5, 10, 20, 25]. The function then returns the average 15. AVERAGE([50, 100,
200, 250], Item/10)
|
2. |
The following example accesses an object array of type BlobFound. The expression extracts the areas of each blob found during the BlobAnalysis step, and the function returns the average of these areas.
AVERAGE(BlobAnalysis.BlobFound, Item.Area)
|
3. |
To avoid an error when you pass an empty array to this function, you could use the following expression. Note that example 2 above is encapsulated in the following IF statement. IF(COUNT([50,
100, 200, 250]) > 0, AVERAGE(BlobAnalysis.BlobFound,
Item.Area) , -1)
|
Specifies the array from which to obtain the elements to average.
Specifies the index of the first element of the subset in the source array.
Specifies the number of elements (beginning at StartIndex) to include in the subset of the source array.
Specifies the expression to apply to each element of the source array.
1. |
The following example applies the expression to the subset of the source array specified by the start index and count [50, 100, 60]. This results in array [5, 10, 6]. The function then returns the average 7. AVERAGE([50, 50,
100, 60, 250], 2, 3, Item/10)
|
2. |
To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement. IF(COUNT([50, 50,
100, 60, 250]) > 0, AVERAGE([50, 50, 100, 60, 250], 2, 3,
Item/10) , -1)
|