Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
dhavalvyas
Contributor III
Contributor III

Class(Count(Distinct [From – To State Code]), 100)

How to write syntax for Bucketing ? How above Expression works ?

2 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi,

If in general, without seeing the data. You have a field named [From-To State Code].

Count(Distinct[From-To State Code])  - counts number of unique (non-repeating) values in the field [From-To State Code].

Function Class returns a string with a range of 100.

For example,

1) if Count(Distinct[From-To State Code]) = 45, expression Class(Count(Distinct[From-To State Code]), 100) return a string '0<=x<100'

2) if Count(Distinct[From-To State Code]) = 156, expression Class(Count(Distinct[From-To State Code]), 100) return a string '100<=x<200'

3) if 100 to replace 400 and Count(Distinct[From-To State Code]) = 620, expression Class(Count(Distinct[From-To State Code]), 400) return a string '400<=x<800'


For more information about function Class(), see here class ‒ QlikView


Regards,

Andrey

dhavalvyas
Contributor III
Contributor III
Author

Thank you so much