Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
nira
Contributor III
Contributor III

Classify data into quantiles

The out of the box functionality in Qlik classifies data into equal intervals and does not allow me to choose the number of classes used to classify the data. For example, when mapping on a measure Qlik defaults to using 7 classes. How can I change it to 5 classes?

Qlik also classifies data using the equal interval method as default. Is there a way to change the data classification method and classify data into quantiles? Can this be achieved in the expression editor using an expression?

3 Replies
mato32188
Specialist
Specialist

Hi @nira ,

pls check the following link (https://community.qlik.com/t5/QlikView-App-Dev/Quartile/td-p/232629). It could potentially help you.

m

ECG line chart is the most important visualization in your life.
nira
Contributor III
Contributor III
Author

Hi,

Thank you for the response! I have a couple follow-up questions.

Using the link you provided, I was able to figure out how to classify data into quintiles using this expression:

=if([Rate] <= fractile(TOTAL [Rate], 0.2), '#e66101',
if([Rate] <= fractile(TOTAL [Rate], 0.4), '#fdb863',
if([Rate] <= fractile(TOTAL [Rate], 0.6), '#f1eac8',
if([Rate] <= fractile(TOTAL [Rate], 0.8), '#b2abd2',
if([Rate] <= fractile(TOTAL [Rate], 1), '#5e3c99', '#b9b3af')))))

However, when I use the colour by expression method to colour my map, it does not display a legend. Is there a way to display a legend showing the ranges for each category/quantile?

Also, I realize that the fractile expression plays a key role in calculating the quantiles. If I wanted to classify the data using a different method, such as equal intervals or natural breaks, what are the appropriate expressions used for these classification methods?

mato32188
Specialist
Specialist

Hi @nira ,

unfortunately Qlik is not able to show legend once using coloring by expression. I always use text&image object and a bit of creativity to set up legend in such cases.

The answer to your 2nd question could be possibly found at https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/functions-in-s... as my knowledge is limited. Hope you can find the answer over there. 

BR

m

ECG line chart is the most important visualization in your life.