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

sorting legend

Hi,

I have a field called Priority which has the following values: High, Medium, Low, Waiting and blanks.

To gather the results of only High, Medium and Low, i used the following:

if("Priority"='Low', "Final Risk Rating", if( "Priority" = 'Medium', "Priority", if ("Priority" = 'High',"Priority"))) as "Priority"

and stored the results in a qvd file. When I load the data out from the qvd file, i used the following code:

if(lower("Priority")='low',dual('Low',3),if(lower("Priority")='Medium',dual('Medium',2),dual('High',1))).

However, the legend comes out in the ordre of High, Low then Medium. How do I sort the legend properly into High, Medium, Low (or Low, Medium, High)?

Capture.PNG

Also, is it possible to change the colours of the legend to whatever i want? Currently, the colours as shown below are not what I want. I want the >90% to be blue, 80-90% be yellow and <80% be red. How should i do this?

Capture.PNG

Thanks!

9 Replies
shraddha_g
Partner - Master III
Partner - Master III

For Priority,

Use Sort by Expression,

Pick(Wildmatch(PriorityFieldName, 'High','Medium','Low'),1,2,3)

and Sort it in Ascending.

For 2nd Legend Set

Sort it by Expression,

Pick(Wildmatch(FieldName,'>90%','80-90%','<80%'),1,2,3)

This will automatically change colors.

Not applicable
Author

Hi,

Adding the first expression only flipped the graph upside down. I want the graph to stack from low to high which is originally correct. I only want to change the position of the legend to go from High, Medium Low or the other way roundCapture.PNG

For the 2nd expression, nothing changed when i added it in. Any idea why?

Thanks!

kenphamvn
Creator III
Creator III

Try this

Create Dimension Piority

=DUAL(PriorityFieldName,if(lower(PriorityFieldName)='low',1, if(lower(PriorityFieldName)='medium',2,3)))

Not applicable
Author

Hi,

the chart flipped opposite to what Shraddha's expression did, which was the direction i wanted, but the legend still remains at High, Low Medium. Any idea why?

Thanks!

shraddha_g
Partner - Master III
Partner - Master III

check sequence of Dimension n Measure in Sorting Tab.

Measure should not be above this Priority Dimension

kenphamvn
Creator III
Creator III

Hi

Please see attached app

Regards

shraddha_g
Partner - Master III
Partner - Master III

Share Screenshot of Sorting Tab

Anonymous
Not applicable
Author

By Using Ageing Bucket

T1:

LOAD *,

if(Priority >=1 and Priority <=80,Dual('LOW',1),

if(Priority >=80 and Priority <=90,Dual('Medium',2),

if(Priority >=90 and Priority <=100,Dual('High',3),)))as PriorityLevel;

T2:

LOAD * INLINE

[

Name,Priority

Name1,        25

Name2,        41

Name3,        51

Name4,        61

Name5,        71

Name6,        81

Name7,        91

Name8,        56

];

Regards

Tahemas Momin

shraddha_g
Partner - Master III
Partner - Master III

In Sorting Tab, Your Priority Field Should come before Measure