Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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

View solution in original post

3 Replies
Not applicable
Author

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

Miguel_Angel_Baeyens

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

Michael_Tarallo
Employee
Employee

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