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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create dimensions based on percentage ?

Hi all,

I want to study analytics from websites.

To do so, I want to slice all my sample in chunk of 5% to have the following thing in X-Avis :

1. 0-5%

2. 6-10%

...

.95-100%

How can I create automatically if possible this axis from my data ?

Can I use the function class() ?

Thanks in advance.

1 Reply
pover
Partner - Master
Partner - Master

If the ranges are the same and in your example that would be the case as each range is 5% then you can use the class function. What information are you dividing up? If the information is fixed it should just be a class(Field,5%,x,0). I'm not sure it is going to take the 5% as a number, but give it a try.

If the grouping is fixed you can also create these groups in the script. If the grouping is based on a calculation you may have to use an aggr() within the class function. For example, class(aggr(sum(Sales)/sum(total Sales),Customer),5%,x,0).

If the ranges are of varying lengths (e.g. 0-20%,20-100%) then investigate the valuelist function in the forum.

Regards.