Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Cloud Maintenance is scheduled between March 27-30. Visit Qlik Cloud Status page for more details.
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.