Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikbbguser
Contributor III
Contributor III

Date not sorting correctly in a combo chart

hello,

I created a combo chart with two measures and 1 dimension. The dimension/X axis is in format of "YYYY-MMM (example: 2023-Dec) ".

 

I would like to sort the X axis from oldest to newest date but can't figure out how. Any insights? In a line or bar chart where there is only one measure, the date sorting seems to be working fine.

Thanks!



Labels (1)
  • Chart

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Your date field is perhaps not a real date (numeric) field but text. You need to convert at the script or at the UI. One quick way if to use date parsing function date#(), like:

Date#(fieldName, 'YYYY-MMM')  // in UI, i.e. - sort by expression
or,
Date(Date#(fieldName, 'YYYY-MMM') , 'YYYY-MMM') as fieldName    // in script

View solution in original post

3 Replies
Raju_6952
Creator III
Creator III

Hi ,

Can you please try the option sort by expression as follows.

Year*100+Month something like this then it will sort numerically.

Regards,

Raju

 

tresesco
MVP
MVP

Your date field is perhaps not a real date (numeric) field but text. You need to convert at the script or at the UI. One quick way if to use date parsing function date#(), like:

Date#(fieldName, 'YYYY-MMM')  // in UI, i.e. - sort by expression
or,
Date(Date#(fieldName, 'YYYY-MMM') , 'YYYY-MMM') as fieldName    // in script

qlikbbguser
Contributor III
Contributor III
Author

that works - thank you!