7 Replies Latest reply: Jul 21, 2017 2:01 PM by René Valencourt

Sorting a bar chart by two criteria in Sense

In the below image, I want to sort so that Nation is first, A is second, then A1 thru A4 by descending value.  In the settings it looks as though this is possible, but it is not working.  I've created a Sort column, where Nation is 1, A is 2, and the others are 3.  I made the dimension the primary sort column, checked 'by Expression,' and entered, '=Max(Sort).'  Then I checked to sort by value, descending.  (I also tried with the dimension by expression only, and the measure by descending value.)

When I choose to sort only by the 'Sort' column OR descending value, each works correctly.  When I try to combine them, A1-A4 seem to display by load order.  How can I achieve the desired result?  The app is attached.

Thanks

• Re: Sorting a bar chart by two criteria in Sense

Please find the attached below for your sorting issue. I hope you find this helpful. You will just switch off your legend. Pity Qliksense doesn't have text in chart.

• Re: Sorting a bar chart by two criteria in Sense

Thank you Sibusiso, but I can't see what you did--your attached file looks like my own.  Did you attach the right one?

Thanks

• Re: Sorting a bar chart by two criteria in Sense

Thank you--I can see what you did in this one.  It achieves the desired effect, but unfortunately can't be used in my case.  My sample app is just a proof-of-concept, but the real app would have hundreds of territories, so I will need to use a single measure.

Edit: I replied in the wrong place--this was meant as a reply to Sibusiso's second reply.

• Re: Sorting a bar chart by two criteria in Sense

You can use expection function e() to exclude the first few elements then you all the rest of the elements will be shown, will respond with an example in an hours time

• Re: Sorting a bar chart by two criteria in Sense

Hi Godfrey

As promised please find the attached document for the idea I was talking about in the above comment.

• Re: Sorting a bar chart by two criteria in Sense

Hello Sibusiso,

Is there an advantage to using the e() function:

sum({<Relation_display3=e({<Relation_display3={'A','Nation'}>}Relation_display3)>}Value)

...over simply using the "not in" operator?  I.e.,

sum({<Relation_display3-={'A','Nation'}>}Value)

Thanks,

René

• Re: Sorting a bar chart by two criteria in Sense

Hi Godfrey

I have changed the name and made it clearly differential
Please find the below attachment and let me know if you still have issues.

Kindest Regards

Sibusiso