Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
try a calculated dimension using class function:
=class([days open], 10, 'days open')
try a calculated dimension using class function:
=class([days open], 10, 'days open')
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
(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
Thanks, This worked also ![]()