Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
kwdaniels
Partner - Creator
Partner - Creator

Can we control the sort order of legend items in a chart?

See below a line chart that reports revenue trends by quarter, with each quarter being represented by a different colored line. Unfortunately the legend presents the billing quarters out of natural sequence. Is there a way to force them to sort alphabetically?

LegendSequence.png

12 Replies
kwdaniels
Partner - Creator
Partner - Creator
Author

Sorry, I just now saw your question.

We have a SQL-Server-based data warehouse, and we have a date dimension table called DimDate, which includes one row for every day. Each row also includes text values representing the fiscal quarter, month, week, etc. (our fiscal quarters do not correspond exactly to calendar quarters, etc.) Then we link each date row to all our transaction rows, allowing us to roll up and report on whatever level of granularity we prefer.

I'm not sure whether that answers your question; if not, please provide further clarification as to what you are attempting.

brunobertels
Master
Master

Hi Ken,

Try using MATCH() function in Sort by Expression.

Tick the 'Sort by Expression' option in the Sorting tab and write your expression as

=match(YearQuarter, '2014-Q1', '2014-Q2', '2014-Q3', ........, '2015-Q3')

shaun
Contributor
Contributor

the solution is not correct the way which we are using by wildcard