# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for
Did you mean:
Not applicable

## Sort values in a chart legend

Hello togehter,
i created a dimension with
=
IF(A >=1 and A<1.25,'iinteresting',

if(A>=1.25 and A<2.25,'empty',

if(A>=2.25 and A<3.25,'grandfather',

if(A>=3.25 and A<=4,'nearly'))))
My legend at the bar-chart shows the values at following order:
* nearly
* grandfather
* interesting
* empty
But i want that the legend shows the values like my formula. So i write the formula in the formula field at the sort register. but this doesn't work.Can anyone help me please? Thanks!
1 Solution

Accepted Solutions
Creator III

Hi,

You try using the dual function to sort you values.

IF(A >=1 and A<1.25,Dual('iinteresting',1),

if(A>=1.25 and A<2.25,Dual('empty',2),

if(A>=2.25 and A<3.25,Dual('grandfather',3),

if(A>=3.25 and A<=4,Dual('nearly',4)))))

Sort this dimension by numeric. Best way to do this is, create this as a column in back script and use the field in front end as show in this attached post.

Hope this helps you.

-Sridhar

4 Replies
Creator III

Hi,

You try using the dual function to sort you values.

IF(A >=1 and A<1.25,Dual('iinteresting',1),

if(A>=1.25 and A<2.25,Dual('empty',2),

if(A>=2.25 and A<3.25,Dual('grandfather',3),

if(A>=3.25 and A<=4,Dual('nearly',4)))))

Sort this dimension by numeric. Best way to do this is, create this as a column in back script and use the field in front end as show in this attached post.

Hope this helps you.

-Sridhar

Luminary Alumni

Hi,

Have you considered using Dual() function? Something like this...

=

IF(A >=1 and A<1.25, Dual('iinteresting', 1),

if(A>=1.25 and A<2.25, Dual('empty', 2),

if(A>=2.25 and A<3.25, Dual('grandfather', 3),

if(A>=3.25 and A<=4,Dual('nearly', 4)))))

Cheers - DV

Not applicable
Author

Thanks a lot!

Not applicable
Author

But what if the legend doesn't represent each separate member in a dimension;

But a separate expression; i.e. sum of income, sum of bonus ;

What determines the order then?

Community Browser