Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Displaying dimensions on chart as a group

I have a chart with the dimension(x-axis) as hours.

My chart has hours from 0 to 20 - which displays as a very compact chart..

How can I display it as <2 hours,  <4 hours, 4-10 hours and >10 hours.

Thank you.

1 Solution

Accepted Solutions
Not applicable

Re: Displaying dimensions on chart as a group

in the load script,try to create a cluster dimension as:

load

if( hours<2, '<2 hours',

     if( hours<4 and hours>2, '<4 hours',

          if( hours<10 and hours>4, '<4-10 hours',

                    if( hours>10, '>10 hours')))) as clusterHours

3 Replies
Not applicable

Re: Displaying dimensions on chart as a group

in the load script,try to create a cluster dimension as:

load

if( hours<2, '<2 hours',

     if( hours<4 and hours>2, '<4 hours',

          if( hours<10 and hours>4, '<4-10 hours',

                    if( hours>10, '>10 hours')))) as clusterHours

MVP
MVP

Re: Displaying dimensions on chart as a group

Hi Cedric,

You can create those ranges in the load script so for example, given that your data model has a field named "Time"

If(Frac(Now()) * 24 > 10, '>10 Hours', If(Frac(Now()) * 24 > 4, '>4 Hours', If(Frac(Now()) * 24 > 2, '4-10 Hours', '<2 hours') AS TimeRange

Miguel

Employee
Employee

Re: Displaying dimensions on chart as a group

Hello Cedric - what Mario has stated is correct, but you could also put this as a reusable Dimension in the section marked library on the left, without having to use it in the script.

Check out the screens and this video: Using The Master Library (video)

8-4-2014 12-07-25 PM.jpg

Under Dimensions click - Create New

Name and add your expression

8-4-2014 12-08-19 PM.jpg

8-4-2014 12-09-05 PM.jpg

The you can use it in your chart object

8-4-2014 12-10-37 PM.jpg

8-4-2014 12-11-09 PM.jpg

Regards,
Mike Tarallo
Qlik
Community Browser