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

class Script and chart function

The class function assigns the first parameter to a class interval. The result is a dual value with a<=x<b as the textual value, where a and b are the upper and lower limits of the bin, and the lower bound as numeric value.

Syntax:  

class(expression, interval [ , label [ , offset ]])

Return data type: dual

Arguments
Argument Description
interval A number that specifies the bin width.
label An arbitrary string that can replace the 'x' in the result text.
offset A number that can be used as offset from the default starting point of the classification. The default starting point is normally 0.
Example: Chart expressions
Example Result
class( var,10 ) with var = 23 Returns 20<=x<30
class( var,5,'value' ) with var = 23 Returns 20<= value <25
class( var,10,'x',5 ) with var = 23 Returns 15<=x<25

Some of the examples in this topic use inline loads. For more information, see Using inline loads to load data.

Example - class fundamentals

Example - class scenario

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 – please let us know!