Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Class Field()

any one can explain class field?

7 Replies
swuehl
MVP
MVP

Not sure what class field should be, are you talking about class() function?

From the Help file:

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

Creates a classification of expressions. The bin width is determined by the number set as interval. The result is shown as a<=x<b, where a and b are the upper and lower limits of the bin. The x can be replaced by an arbitrary string stated in label. 0 is normally the default starting point of the classification. This can be changed by adding an offset.

Examples:

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'

Not applicable
Author

Thank you for your answer swuel

sunny_talwar

If this is what you were looking for, I would suggest closing the thread by marking the swuehl's answer as correct.

Best,

Sunny

swuehl
MVP
MVP

If you need more information, there are a couple of samples here in the forum, e.g.

class() explain them in qlikview

Just search for class, the function is also often used with histograms so a search for that might also help.

Not applicable
Author

i'm asking about class() only

sunny_talwar

If you are looking for an example I have created a sample which uses class() function both in the front end and back end. Back end is in the script:

Table:

LOAD *,

  Class(Age, 10) as ClassScript;

LOAD Floor(Rand() * 100) as Age,

  If(Rand() <=0.50, 'Male', 'Female') as Gender

AutoGenerate 100000

Front end option uses it in the chart as calculated dimension:

Capture.PNG

I am attaching the qvw document for you to review.

HTH

Best,

Sunny

SatyaPaleti
Creator III
Creator III

Hi Srikanth,

Go through following link

It may help you

Function CLASS

Thank you,

Satya paleti