Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
CodeKazuko
Contributor III
Contributor III

Sort Year Month by Expression

How to sort year month by Jan-2020 to Dec-2020? I have tried max(Date), Date(Monthstart(Date),'MMM-YYYY') as expressions. I even tried tried changing script to number like 12022 and it still didn't sort by month.

Labels (5)
2 Replies
Jobson_joseph
Contributor II
Contributor II

if you are trying to sort it in any chart, you can goto "sorting" and change there.

vinieme12
Champion III
Champion III

you were close

sort by expression

=Monthstart(Date#(yearmonthfield,'MMM-YYYY'))

 

or even better would be to load the yearmonthfield as a dual value field

,Dual(yearmonthfield,Monthstart(Date#(yearmonthfield,'MMM-YYYY'))) as yearmonthfield

 

Then just sort by Numeric value of this field

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.