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

Changing the order of the items in legend of a chart

I have a stacked bar chart with different stages grouped by color and a legend next to it.

The order of these stages are in a wrong order in legend; starting from top with 5 and 4, 2, 3, 1. How can I make it so that it's in an ascending order like 1, 2, 3, 4, 5?

Thank you!

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

Create new Dimension:

if(Stage='3_PPP',Dual('1.PPP',1),

if(Stage='2_FP',Dual('4.FP',5),

if(Stage='1_ID',Dual('5.ID',4),

if(Stage='4_R/N',Dual('3.R/N',3)

,if(Stage='5_ Final',Dual('2.Final',2))))))

And ad it instead of the Stage one.

View solution in original post

16 Replies
robert_mika
Master III
Master III

Does this help?

2015-09-04_234631.png

sunny_talwar

I suggest not creating duplicate threads: Changing the order of the items in legend of a chart

ogster1974
Partner - Master II
Partner - Master II

‌hi seona in sense there is a section in your chart design panel for sorting your data.

MOving the dimensions and measures up or down in the section changing the priority in which it is sorted.   You can also go into each data set and sort by ascending, descending or expression.  

THis should help you address your sorting issue.

Regards

Andy

Not applicable
Author

1.pngFor some reason I am not able to move 'Stage' above the 'Month' dimension. but at the same time, I need them to both organized so that they both ascend numerically. With those settings, I still get the sorting below.

2.png

ogster1974
Partner - Master II
Partner - Master II

Looking at your stage data its not numeric rather Alphanumeric in nature so try sorting Alphabetically on stage.

To get round the not being able to move the first sort column I sort by expression and identify the field I want to sort by in there. so in your case =Stage in the sort by expression on month section.

Your month im hoping is a number e.g. 1,2,3, etc if not Jan, Feb, Mar you will need to include a month order field in your data load to get this working properly.

Regards

Andy

Not applicable
Author

Hi Andy,

Even if I sort alphabetically on stage, the order is wrong..

Could you elaborate on '=Stage in the sort by expression on month section?'

And yes, the months are in numbers.

Thank you!

robert_mika
Master III
Master III

Could you post your qvf file?

Not applicable
Author

I cannot share the whole qvf file that im currently working on due to some confidential information. Is there a way to share the qvf file by reducing the data?

robert_mika
Master III
Master III

Make a copy if the file, then go to Data Load Editor and remove tables/fields you do not want to show.