RangeCount - script and chart function
RangeCount() returns the number of values, text and numeric, found within the specified range or expression.
Syntax:
RangeCount(first_expr[, Expression])
Return data type: integer
Arguments:
The argument expressions of this function may contain inter-record functions with a third optional parameter, which in themselves return a range of values.
Argument | Description |
---|---|
first_expr | The expression or field containing the data to be measured. |
Expression | Optional expressions or fields containing the range of data to be measured. |
Limitations:
NULL values are not counted.
Examples and results:
Examples | Results | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RangeCount (1,2,4) |
Returns 3 |
||||||||||||||||
RangeCount (2,'xyz') |
Returns 2 | ||||||||||||||||
RangeCount (null( )) | Returns 0 | ||||||||||||||||
RangeCount (2,'xyz', null()) | Returns 2 | ||||||||||||||||
Add the example script to your app and run it. Then add, at least, the fields listed in the results column to a sheet in your app to see the result. RangeTab3: LOAD recno() as RangeID, RangeCount(Field1,Field2,Field3) as MyRangeCount INLINE [ Field1, Field2, Field3 10,5,6 2,3,7 8,2,8 18,11,9 5,5,9 9,4,2 ]; |
|
Example with expression:
RangeCount (Above(MyField,1,3))
Returns the number of values contained in the three results of MyField. By specifying the second and third arguments of the Above() function as 3, it returns the values from the three fields above the current row, where there are sufficient rows, which are taken as input to the RangeSum() function.
Data used in examples:
MyField | RangeCount(Above(MyField,1,3)) |
---|---|
10 |
0 |
2 | 1 |
8 | 2 |
18 | 3 |
5 | 3 |
9 | 3 |
Data used in examples:
RangeTab:
LOAD * INLINE [
MyField
10
2
8
18
5
9
] ;