Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content Skip to complementary content

RangeCount - script and chart function

RangeCount() returns the number of values, both text and numeric, in the expression or field.

Syntax:  

RangeCount(first_expr[, Expression])

Return data type: integer

Arguments:  

The arguments of this function may contain inter-record functions which in themselves return a list of values.

Arguments
Argument Description
first_expr

The expression or field containing the data to be counted.

Expression

Optional expressions or fields containing the range of data to be counted.

Limitations:  

NULL values are not counted.

Examples and results:  

Function examples
ExamplesResults
RangeCount (1,2,4)

Returns 3

RangeCount (2,'xyz')

Returns 2
RangeCount (null( ))Returns 0
RangeCount (2,'xyz', null())Returns 2

Example:  

Add the example script to your app and run it. To see the result, add the fields listed in the results column to a sheet in your app.

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

];

The resulting table shows the returned values of MyRangeCount for each of the records in the table.

Results table
RangeID MyRangeCount
1 3
2 3
3 3
4 3
5 3
6 3

Example with expression:

RangeCount (Above(MyField,1,3))

Returns the number of values contained in the three results of MyField. By specifying the first argument of the Above() function as 1 and second argument as 3, it returns the values from the first three fields above the current row, where there are sufficient rows, which are taken as input to the RangeCount() function.

Data used in examples:

Sample data
MyField RangeCount(Above(MyField,1,3))

10

0
21
82
183
53
93

Data used in examples:

RangeTab:

LOAD * INLINE [

MyField

10

2

8

18

5

9

] ;

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!