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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Grouping Data in a Dimension on a Chart

Hi,

I have created a chart in Qlikview, the dimension is days open and the y axis (expression) number of cases open.

The x axis is like 1,4,6,8,12,15,25,27,30 etc how can i group the dimension so the scale of this field is 1-10,11-20,21-30 so it doesnt show every piece of data on the x axis so that the graph with group the data and the count of number of cases will be the some of all the days open between 1-1-0 for example.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

try a calculated dimension using class function:

=class([days open], 10, 'days open')

View solution in original post

4 Replies
swuehl
MVP
MVP

try a calculated dimension using class function:

=class([days open], 10, 'days open')

Not applicable
Author

Hi,

Thanks for answering so quickly!

That worked which is great! The only thing i don't like about it is that on the graph it is 0<= days open <10, does it have to be in that format can it not literally be 1-10, also is there a possibilty to have 0, 1-10, 11-20,20-30, 31+ ?

Laura

swuehl
MVP
MVP

(The format of your dimension using class() function is somewhat limited.

You could try using a if() conditions to handle the lower and upper limits separately, and use the fourth parameter to class() function to use an offset. But I believe this won't look any better than

=if(Value2=0,text('0'),if(Value2>30,'31+',class(Value2,10,'Value',1))) count(Date)

100
0 1
1 <= Value < 11 10
11 <= Value < 21 10
21 <= Value < 31 10
31+ 69

And if you start using conditionals, you could also replace the class completely, then you are free with formatting:

=if(Value=0,'0'

,if(Value<=10,'1-10'

,if(Value<=20,'11-20'

,if(Value<=30,'21-30','30+'

))))

=if(Value=0,'0',if(Value<=10,'1-10',if(Value<=20,'11-20',if(Value<=30,'21-30','30+')))) count(Date)

100
0 1
1-10 10
11-20 8
21-30 16
30+ 65

(different data used than in table above)

You can use something like this also in your load script, creating a new field to classify your days open field, which is what I prefer over doing the classification in a calculated dimension.

Regards,

Stefan

Not applicable
Author

Thanks, This worked also