9 Replies Latest reply: Sep 11, 2017 7:01 AM by Shraddha Gajare

# 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)?

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?

Thanks!

• ###### Re: sorting legend

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.

• ###### Re: sorting legend

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 round

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

Thanks!

• ###### Re: sorting legend

check sequence of Dimension n Measure in Sorting Tab.

Measure should not be above this Priority Dimension

• ###### Re: sorting legend

Try this

Create Dimension Piority

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

• ###### Re: sorting legend

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!

• ###### Re: sorting legend

Hi

Regards

• ###### Re: sorting legend

In Sorting Tab, Your Priority Field Should come before Measure

• ###### Re: sorting legend

Share Screenshot of Sorting Tab

• ###### Re: sorting legend

By Using Ageing Bucket

T1:

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:

[

Name,Priority

Name1,        25

Name2,        41

Name3,        51

Name4,        61

Name5,        71

Name6,        81

Name7,        91

Name8,        56

];

Regards

Tahemas Momin