Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting Chart axis by Day/Month

Hi

I have the following chart with a derived Day/Month Axis that is used if the document is filtered for 30 Days or Less:

day_month_chart.PNG

I'm having difficulty sorting the x-axis in ascending order.  Im creating the Day/Month field during the load :

day(actual_date) & '-' & Month(actual_date) as [Day/Month],

If a the document is filtered for more than 30 days then a derived field of MonthYear is used :

date(monthstart(actual_date), 'MMM-YY') 

the chart is sorted correctly when this is used.

Any help is appreciated.

Tom

4 Replies
MK_QSL
MVP
MVP

Create your field as below and sort by numeric asc or desc order.


Date(actual_date,'DD-MMM')

Not applicable
Author

Hey,

Did you try load order in sorting ?

Regards,

Navdeep

Not applicable
Author

Load order option is 'greyed out'

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Use Manish's suggestion (which is the best technique AFAIK) or in the sort tab, use sort by expression and put =actual_date in the expression field. Don't forget to select "Ascending".

The reason why your [Day/Month] field isn't working as expected is that the concatenation operation in your script stores a text-only value into [Day/Month], thereby losing the underlying numeric date value. Text values obey different sorting rules.

Peter