Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I was wondering how to use intervals instead individual values.
I've a ticket table which contains all the support tickets and their solution time (like this)
TICKET CATEGORY SOLUTION TIME (Hours)
123 A 4
231 A 8
34454 B 15
3422 A 8
777 b 4
66 b 20
I would display the table using intervals , like this:
Nr.TICKET SOLUTION TIME
2 0 <= 5
2 >5 <= 10
1 > 10 <= 15
1 > 15
HOw can I do it ?
Help please
Thanks in advance
Hi,
you could try the class function
class(expression, interval [ , label [ , offset ]])
Creates a classification of expressions. The bin width is determined by the number set as interval. The result is shown as a<=x<b, where a and b are the upper and lower limits of the bin. The x can be replaced by an arbitrary string stated in label. 0 is normally the default starting point of the classification. This can be changed by adding an offset.
Examples:
class( var,10 ) with var = 23 returns '20<=x<30'
class( var,5,'value' ) with var = 23 returns '20<= value <25'
class( var,10,'x',5 ) with var = 23 returns '15<=x<25'
So, in a chart you could add =Class([SOLUTION TIME (Hours)],5) as calculated dimension and Count(TICKET) as expression
Hi bibopipo,
try like this:
IntervalMatch (Url_Rest)
LOAD * INLINE [
Start2, End2
0, 5
6, 10
11, 15
16, 40
];
(With IntervalMatch() you need closed intervals, that's why I put the upper limit for the last interval at 40 - you could use any value, but there has to be a limit)
HTH
Best regards,
DataNibbler
Hi,
you could try the class function
class(expression, interval [ , label [ , offset ]])
Creates a classification of expressions. The bin width is determined by the number set as interval. The result is shown as a<=x<b, where a and b are the upper and lower limits of the bin. The x can be replaced by an arbitrary string stated in label. 0 is normally the default starting point of the classification. This can be changed by adding an offset.
Examples:
class( var,10 ) with var = 23 returns '20<=x<30'
class( var,5,'value' ) with var = 23 returns '20<= value <25'
class( var,10,'x',5 ) with var = 23 returns '15<=x<25'
So, in a chart you could add =Class([SOLUTION TIME (Hours)],5) as calculated dimension and Count(TICKET) as expression
Hi,
I would solve it in the script en handle it from there.
Table:
load * inline [
TICKET, CATEGORY, TIME
123,A,4
231,A,8
34454,B,15
3422,A,8
777,b,4
66,b,20
];
Sorttable:
Load
TICKET,
CATEGORY,
TIME,
if(TIME < 5, 1, if(TIME >5 and TIME <=10, 2, if(TIME >10 and TIME <=15, 3, 4 ))) as SolTimeCode
Resident Table;
Drop table Table;
Regards,
Gerrit
THANKS !!!