7 juli 2022 Bucket analysis in Qlik Sense with the Class() function Deel dit bericht Every Friday at Bitmetric we’re posting a new Qlik certification practice question to our LinkedIn company page. Last Friday we asked the following Qlik Data Architect certification practice question about creating buckets (or intervals) in Qlik using the Class() function: The correct answer is A: Class(Age, 5) Judging by the amount of reactions this week this must be a well-known function! And it is great to say that all answers were right. Something which is not strange since the Class() function is a great way to quickly create buckets to help in doing analysis. The class() function can be used as a script or as a chart function and by looking at the syntax below, should minimally consist of the expression and the interval. In the expression we enter the numeric value to evaluate. This can be a fixed number, but also a field name, seeing as we used the Age field in the question. class(expression, interval [ , label [ , offset ]]) The interval determines the range on which the values will be classed. So in the example we used 5 as the interval, meaning we use increments of 5 to class all values in. So for example from 0 to 5, from 5 to 10 etc, etc. The class() function standardly creates these classes shown as below: lower limit <= x (label) < higher limit This brings us to the possibility of the label. Normally the class is depicted as shown above, so the class from 0 to 5 will be shown as the value: 0 <= x < 5 (see fig 1.), having an x as label in the value. This can be changed by adding a label to the syntax, bring it towards something more understandable (see fig 2.) or using the replace function (Replace(Class(Age, 5), ‘<= x <’, ‘ to ‘) to fully customize the result (shown in fig 3.). The final possibility in the syntax is to use an offset. For example, if you want increments of 10, but only start at number 21, you can use Class(Age, 5, ‘age’, 21) as syntax to start at 21. Keep in mind that in this case you need to give a label, otherwise the offset will be seen as the label. Also if you have results below the given offset, this function will take that into account and count back as seen in figure 4. Some other things to keep in mind If there are no values, there is no class created. For example there are no 5 to 10, or 10 to 15 classes, since there are no values over there. The classes are not customizable per class. It is always the same increment as given. In this example the data set only contains from age 18 and onwards. The 7 values which are below that are values with 0, but due to the classes which are created it is difficult to determine data quality issues. The classes are not customizable. The increments are fixed according to the interval given. If you want to have more control, use classes of various lengths or add some information to control data quality, it is worth looking at nested if statements or IntervalMatch solutions in the script. That’s it for this week. See you next Friday? More from the Bitmetric team Qlik Cloud Backup Protect your investment in Qlik with daily incremental backups stored in an encrypted environment with redundant storage. Available for as little as 2 Euro per day. Learn more. Join the team! Do you want to work within a highly-skilled, informal team where craftsmanship, ingenuity, knowledge sharing and personal development are valued and encouraged? Check out our job openings. Friday Qlik Test Prep Functions Solution Hoe kunnen we je ondersteunen? Barry beschikt over meer dan 20 jaar ervaring als architect, developer, trainer en auteur op het gebied van Data & Analytics. Hij is bereid om je te helpen met al je vragen. Bel ons Mail ons 10 maart 2025 Qlik Data Flow: Simplifying Data Transformation Without Code Qlik Data Flow simplifies data transformation with a visual editor. Clean, join, and reshape data using drag and drop, no coding needed. Automatically generate Qlik script as you build. Learn how it works, see a step-by-step example, and compare it to Qlik Data Manager and Qlik Script. ETL No-Code Qlik Script 6 maart 2025 Just because your data is in the cloud does not make it safe. Qlik Cloud does not automatically back up your data, leaving your apps vulnerable to loss, corruption, or accidental deletion. Learn why a backup solution is essential and how Bitmetric’s Qlik Cloud Backup keeps your data safe. Take action now to protect your analytics Governance Qlik Security Support 24 februari 2025 Update: Qlik Cloud icons collection Discover our updated collection of 239 Qlik Cloud icons on GitHub. Featuring new Data Flow icons in SVG and PNG formats, perfect for enhancing your Qlik schematics and documentation. Qlik Visualization
10 maart 2025 Qlik Data Flow: Simplifying Data Transformation Without Code Qlik Data Flow simplifies data transformation with a visual editor. Clean, join, and reshape data using drag and drop, no coding needed. Automatically generate Qlik script as you build. Learn how it works, see a step-by-step example, and compare it to Qlik Data Manager and Qlik Script. ETL No-Code Qlik Script
6 maart 2025 Just because your data is in the cloud does not make it safe. Qlik Cloud does not automatically back up your data, leaving your apps vulnerable to loss, corruption, or accidental deletion. Learn why a backup solution is essential and how Bitmetric’s Qlik Cloud Backup keeps your data safe. Take action now to protect your analytics Governance Qlik Security Support
24 februari 2025 Update: Qlik Cloud icons collection Discover our updated collection of 239 Qlik Cloud icons on GitHub. Featuring new Data Flow icons in SVG and PNG formats, perfect for enhancing your Qlik schematics and documentation. Qlik Visualization