Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Expression


Hi,

   I have a dimension field  Days  which contains number of days. I need to categerise those days in to 4 categeories

Like   <180, 181-360, 361-540,  >540.  For that I need expression

Thanks,

MLNR

4 Replies
its_anandrjs

Hi,

Try to create the buckets

Load

if(Day < 180,'<180',

If(Day > 180 and Day < 360, '360',

If(Day > 361 and Day < 540,'>361-540',

If(Day >540,'>540')))) as DayBucket

From Source;

Or you can use the Class function in the front end.

Regards

Anand

PrashantSangle

Hi,

Read Article written by Henric about how to create bucket

http://community.qlik.com/blogs/qlikviewdesignblog/2014/07/14/buckets

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
its_anandrjs

Hi,

Better you load this way example with simple bucket creation in the load script.

1.

Data:

LOAD RowNo() as Day

AutoGenerate 1000;

LOAD

Day,

if(Day <= 180,'<180',

If(Day >= 180 and Day <= 360, '>180-360',

If(Day >= 361 and Day <= 540, '>361-540',

If(Day >540,'>540')))) as DayBucket

Resident Data;

DROP Table Data;

2. And in Dimension you can use without creating buckets

=Class(Day,180)

Regards

Anand

avinashelite

try with INTERVALMATCH() function

The general syntax is:

intervalmatch (matchfield) (loadstatement | selectstatement )

matchfield is the field containing the discrete numeric values to be linked to intervals.

loadstatement or selectstatement must result in a two-column table, where the first field contains the lower limit of each interval and the second field contains the upper limit of each interval. The intervals are always closed, i.e. the end points are included in the interval. Non-numeric limits render the interval to be disregarded (undefined).