Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Arnec
Contributor III
Contributor III

Sorting Bar Chart

Hi

I've created a bar chart with clustered columns but can't quite find the way to sort them correctly. I'm currently showing data for the turnover of the last 5 years per country. I sort on the turnover of this year. However I have the possibility to filter on Year, Month, Day, Country, Customer group, ... and so on and this seems to work but the sorting won't follow. I've tried several options by trying to calculate the maximum item selected in year and so on, but I can't get to the result. 

In the end I would want this bar chart always to sort descending. 

I have the following set up:

Dimension

CountryName

Expression(s) - I have 4 in total in which the 0 below changes from 0 to -4 the get 5 clustered columns. I'm currently also using the expression below to sort (which I know is wrong)

=if(Match(GetFieldSelections(_verSelection), 'Turnover'),
sum(if (InYear (DocDate, today(), 0), Turnover))
,
sum(if (InYear (DocDate, today(), 0), Turnover - Cost))
)

1 Reply
Brett_Bleess
Former Employee
Former Employee

For these types of posts, it is most helpful if you can attach an example QVW file, so folks can look into the data model, expressions and chart properties to try to sort out why things are not working properly, bit difficult to help otherwise.  The best alternative I have would be the Help to see if you can find something specific there to the sorting in that chart type, or you can check the Design Blog area for ideas/examples to see if you can find something to help there:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Help link:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Bar_Chart.htm

Sorry I do not have anything better.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.