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

Dates in chart are not sorting correctly

Hi, very new to qliksense, still trying to get my head around some things. 

Someone has already kindly help me build a combo chart for my dashboard utilising the load editor, however, the dates on the x-axis are not formatting/sorting correctly. I would obviously like the dates to run in ascending order. I think maybe the dates aren't formatted as dates perhaps?

Please see below example picture. 

Sam_Thomas_0-1616672434015.png

 

Please let me know if you require any more information. Any help would be greatly appreciated. 

Labels (3)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

... if monthName() doesn't meet your demands then try this.

=If(Not(IsNull(CalendarDate)), Dual(Month(CalendarDate)&' '&Year(CalendarDate), monthname(CalendarDate)))

View solution in original post

7 Replies
deshikas
Contributor III
Contributor III

Use Dual function around the date

Sam_Thomas
Creator
Creator
Author

Thanks for the answer. 

My dimension expression is =If(Not(IsNull(CalendarDate)),Month(CalendarDate)&' '&Year(CalendarDate))

How would I go about using a Dual Function?

Thanks.

deshikas
Contributor III
Contributor III

in script Dual(calendar date)

 

Vegar
MVP
MVP

You could use monthname if you are OK with the default formatting of that function.

=MonthName(CalendarDate)

Vegar
MVP
MVP

... if monthName() doesn't meet your demands then try this.

=If(Not(IsNull(CalendarDate)), Dual(Month(CalendarDate)&' '&Year(CalendarDate), monthname(CalendarDate)))

Sam_Thomas
Creator
Creator
Author

Brilliant. Worked wonderfully, thanks. 

Sam_Thomas
Creator
Creator
Author

I am not sure if I should start a new thread or not, but I may as well ask. Do you know how I might go about limiting the dimension to only provide the last 12 months worth of data? 

For example, I have data going back to 2017, but I would only want to see the last 12 months? Is this possible?

Thanks again, big help.