Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Intervals

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

1 Solution

Accepted Solutions
bbi_mba_76
Partner - Specialist
Partner - Specialist

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


View solution in original post

4 Replies
datanibbler
Champion
Champion

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

bbi_mba_76
Partner - Specialist
Partner - Specialist

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


Not applicable
Author

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;

qv.gif

Regards,

Gerrit

Anonymous
Not applicable
Author

THANKS !!!