Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Karahs
Partner - Creator
Partner - Creator

Ranging no. of days

i want to create a bucket of ranging numbers

eg. 0-30 31-60 and so on..

8 Replies
oknotsen
Master III
Master III

Create an InLine table in your script.

May you live in interesting times!
Karahs
Partner - Creator
Partner - Creator
Author

Range are for days which is calculated by (max date - min date).

Since it is not a field name i cannot use class function.

oknotsen
Master III
Master III

Create an InLine table and use the IntervalMatch() function instead.

May you live in interesting times!
Karahs
Partner - Creator
Partner - Creator
Author

Can u Please Explain with an Example Since i Am new to Qliksense

NareshGuntur
Partner - Specialist
Partner - Specialist

Have you tried class function?

This is what the help says:

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'

oknotsen
Master III
Master III

Here you go.

May you live in interesting times!
Karahs
Partner - Creator
Partner - Creator
Author

Yes i have tried Class Function as Class(Max Date-Min Date,30) and it gives me an Error Since (Max Date-Min Date) Is not a Field Name but a Calculation

reddy-s
Master II
Master II

Hi Kshitija,

Did you try using interval match in the data load script editor? If not its worth trying.

https://community.qlik.com/servlet/JiveServlet/previewBody/6820-102-1-8547/intevalMatch.pdf