Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW

Chart Legend Sort Order

100% helpful (2/2)
cancel
Showing results for 
Search instead for 
Did you mean: 
ToniKautto
Employee
Employee

Chart Legend Sort Order

Last Update:

May 10, 2022 3:23:50 PM

Updated By:

Jamie_Gregory

Created date:

Jun 25, 2015 2:54:42 AM

There is no setting to affect chart legend sort order. 

For example, in the below legend the dimension values are expected to be sorted according to their numerical ranges. 

Sort order of legends examples 1.png

 

Environment:

Qlik Sense Enterprise on Windows 
Qlik Cloud 
Qlik Sense Business 


 

In Qlik Sense the chart legend is sorted by alphabetical order or numerical order.

Dimension values with no underlying numerical value will be sorted alphabetically. The dimension sort order does not affect the legend. 

 

Resolution:


Chart legend sort order can be customized by enumerating the dimension values. 

The interval values can be enumerated by using the Dual() function. In this example, the lower limit of the intervals could make for suitable numerical values. With a mapping table, the legend enumeration only needs to be maintained in one place. 

Sort order of legends examples 2.png

DimIntervals:
Mapping Load * Inline [
TextValue, NumValue
100-999  , 100
1k-9999  , 1000
10k-     , 10000
];

Load
Dual(Dim1, ApplyMap('DimIntervals', Dim1)) AS Dim1
Inline [
Dim1, Expression1
100-999  , 2321
1k-9999  , 412
10k-     , 454
100-999  , 23
1k-9999  , 4142
10k-     , 4464

];
 

Labels (1)
Version history
Last update:
‎2022-05-10 03:23 PM
Updated by: